]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: plug a memory leak in exec_helper()
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 14 Jun 2012 14:13:01 +0000 (16:13 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 15 Jun 2012 09:52:05 +0000 (11:52 +0200)
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

index 69b5bfc13d8f78cab79981592116320ab0724c6d..e00fbe9d0f1607539ccf06d1a14f61aa2452b57e 100644 (file)
@@ -458,6 +458,7 @@ static int exec_helper(struct libmnt_context *cxt)
                break;
        }
 
+       free(o);
        return rc;
 }