[PATCH 1/3] libmount: plug a memory leak in exec_helper()

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

 



valgrind --leak-check=full ./sys-utils/mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux
....
==21359== 28 bytes in 1 blocks are definitely lost in loss record 1 of 1
==21359==    at 0x4C298B2: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21359==    by 0x415780: __mnt_optstr_append_option (optstr.c:188)
==21359==    by 0x415CB5: mnt_optstr_set_option (optstr.c:387)
==21359==    by 0x40D778: do_mount (context_mount.c:192)
==21359==    by 0x40E6A9: mnt_context_do_mount (context_mount.c:685)
==21359==    by 0x40EB7B: mnt_context_mount (context_mount.c:786)
==21359==    by 0x4058B0: main (mount.c:918)

Signed-off-by: Petr Uzel <petr.uzel@xxxxxxx>
---
 libmount/src/context_mount.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 69b5bfc..e00fbe9 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -458,6 +458,7 @@ static int exec_helper(struct libmnt_context *cxt)
 		break;
 	}
 
+	free(o);
 	return rc;
 }
 
-- 
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux