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

Liu Bo bo.liu at linux.alibaba.com
Thu Jun 6 21:43:54 UTC 2019


lo.inodes hashmap was not unref/destroy 'd on quiting, which was caught by valgrind.

Reviewed-by: Dr. David Alan Gilbert <dgilbert at redhat.com>
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 959d74d..57508df 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -2321,6 +2321,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);
-- 
1.8.3.1




More information about the Virtio-fs mailing list