[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH 05/17] tools: block-remus: fix memory leak
On Oct 13, 2014 10:13 PM, "Wen Congyang" <wency@xxxxxxxxxxxxxx> wrote:
>
> Fix the following two memory leak:
> 1. If s->ramdisk.prev is not NULL, we merge the write requests in
> Â Âs->ramdisk.h into s->ramdisk.prev, and then destroy s->ramdisk.h.
> Â ÂBut we forget to free hash value when destroying s->ramdisk.h.
>
> Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
> Signed-off-by: Jiang Yunhong <yunhong.jiang@xxxxxxxxx>
> Signed-off-by: Wen Congyang <wency@xxxxxxxxxxxxxx>
> Cc: Shriram Rajagopalan <rshriram@xxxxxxxxx>
> ---
> Âtools/blktap2/drivers/block-remus.c | 2 +-
> Â1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/blktap2/drivers/block-remus.c b/tools/blktap2/drivers/block-remus.c
> index fd5f209..55363a3 100644
> --- a/tools/blktap2/drivers/block-remus.c
> +++ b/tools/blktap2/drivers/block-remus.c
> @@ -599,7 +599,7 @@ static int ramdisk_start_flush(td_driver_t *driver)
> Â Â Â Â Â Â Â Â }
> Â Â Â Â Â Â Â Â free(sectors);
>
> -Â Â Â Â Â Â Â Âhashtable_destroy (s->ramdisk.h, 0);
> +Â Â Â Â Â Â Â Âhashtable_destroy (s->ramdisk.h, 1);
> Â Â Â Â } else
> Â Â Â Â Â Â Â Â s->ramdisk.prev = s->ramdisk.h;
>
> --
> 1.9.3
>
Acked-by: Shriram Rajagopalan <rshriram@xxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|