util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] libmount: plug a memory leak in exec_helper()
@ 2012-06-14 14:13 Petr Uzel
  2012-06-14 14:13 ` [PATCH 2/3] libmount: fix read before allocated buffer Petr Uzel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Petr Uzel @ 2012-06-14 14:13 UTC (permalink / raw)
  To: util-linux

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@suse.cz>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-15  9:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 14:13 [PATCH 1/3] libmount: plug a memory leak in exec_helper() Petr Uzel
2012-06-14 14:13 ` [PATCH 2/3] libmount: fix read before allocated buffer Petr Uzel
2012-06-15  9:54   ` Karel Zak
2012-06-14 14:13 ` [PATCH 3/3] libmount: fix trivial typos Petr Uzel
2012-06-15  9:54   ` Karel Zak
2012-06-15  9:53 ` [PATCH 1/3] libmount: plug a memory leak in exec_helper() Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).