qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [Qemu-devel] [PATCH] rbd: avoid qemu_rbd_snap_list() m


From: Michael Roth
Subject: Re: [Qemu-stable] [Qemu-devel] [PATCH] rbd: avoid qemu_rbd_snap_list() memory leak when no snapshots
Date: Tue, 24 Sep 2013 19:28:23 -0500
User-agent: alot/0.3.4

Quoting Stefan Hajnoczi (2013-08-14 07:13:52)
> When there are no snapshots qemu_rbd_snap_list() returns 0 and the
> snapshot table pointer is NULL.  Don't forget to free the snaps buffer
> we allocated for librbd rbd_snap_list().
> 
> Cc: address@hidden
> Signed-off-by: Stefan Hajnoczi <address@hidden>

Ping for 1.6.1

> ---
>  block/rbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/rbd.c b/block/rbd.c
> index cb71751..4e26fea 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -934,7 +934,7 @@ static int qemu_rbd_snap_list(BlockDriverState *bs,
>      do {
>          snaps = g_malloc(sizeof(*snaps) * max_snaps);
>          snap_count = rbd_snap_list(s->image, snaps, &max_snaps);
> -        if (snap_count < 0) {
> +        if (snap_count <= 0) {
>              g_free(snaps);
>          }
>      } while (snap_count == -ERANGE);
> -- 
> 1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]