From b2081cd8856a725c89c4d97b1399c589780b467a Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Wed, 20 Feb 2019 14:49:24 +0530 Subject: fuse : fix memory leak This patch fixes memory leak reported by ASan. Tracebacks: ERROR: LeakSanitizer: detected memory leaks Direct leak of 712 byte(s) in 1 object(s) allocated from: #0 0x7f35139dc848 in __interceptor_malloc (/lib64/libasan.so.5+0xef848) #1 0x7f35136efb29 in __gf_malloc ../libglusterfs/src/mem-pool.c:136 #2 0x7f3510591ce9 in fuse_thread_proc ../xlators/mount/fuse/src/fuse-bridge.c:5929 #3 0x7f351336d58d in start_thread (/lib64/libpthread.so.0+0x858d) SUMMARY: AddressSanitizer: 712 byte(s) leaked in 1 allocation(s). updates: bz#1633930 Change-Id: Ie5b4da6b338d8e5fc770c5b2da1238e3462468ac Signed-off-by: Sunny Kumar --- xlators/mount/fuse/src/fuse-bridge.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/mount/fuse/src/fuse-bridge.c') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index bd8bc114a32..492ce970ff2 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -6054,8 +6054,12 @@ fuse_thread_proc(void *data) cont_err: iobuf_unref(iobuf); GF_FREE(iov_in[0].iov_base); + iov_in[0].iov_base = NULL; } + if (iov_in[0].iov_base) + GF_FREE(iov_in[0].iov_base); + /* * We could be in all sorts of states with respect to iobuf and iov_in * by the time we get here, and it's just not worth untangling them if -- cgit