[Virtio-fs] [PATCH 3/5] virtiofsd: fix memory leak on lo.inodes hashmap

Dr. David Alan Gilbert dgilbert at redhat.com
Thu Jun 6 09:30:21 UTC 2019


* Liu Bo (bo.liu at linux.alibaba.com) wrote:
> lo.inodes hashmap was not unref/destroy 'd on quiting, which was caught by valgrind.
> 
> Signed-off-by: Liu Bo <bo.liu at linux.alibaba.com>
> ---
>  contrib/virtiofsd/passthrough_ll.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
> index f348b16..e7e19dc 100644
> --- a/contrib/virtiofsd/passthrough_ll.c
> +++ b/contrib/virtiofsd/passthrough_ll.c
> @@ -2324,6 +2324,8 @@ err_out2:
>  err_out1:
>  	fuse_opt_free_args(&args);
>  
> +        if (lo.inodes)
> +                g_hash_table_destroy(lo.inodes);
>  	lo_map_destroy(&lo.fd_map);
>  	lo_map_destroy(&lo.dirp_map);
>  	lo_map_destroy(&lo.ino_map);

Reviewed-by: Dr. David Alan Gilbert <dgilbert at redhat.com>

> -- 
> 1.8.3.1
> 
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs at redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / dgilbert at redhat.com / Manchester, UK




More information about the Virtio-fs mailing list