]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/utils: Fix double free error with smbtree
authorNoel Power <noel.power@suse.com>
Wed, 1 Apr 2020 11:26:09 +0000 (12:26 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 3 Apr 2020 12:24:36 +0000 (12:24 +0000)
==3632==
WORKGROUP
\\ATP
\\ATP\IPC$            IPC Service ()
==3632== Invalid read of size 8
==3632==    at 0x773C926: poptResetContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x773E5DD: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x10A8BC: main (smbtree.c:354)
==3632==  Address 0x16085e00 is 640 bytes inside a block of size 784 free'd
==3632==    at 0x4C2F1AD: free (vg_replace_malloc.c:530)
==3632==    by 0x773E6F7: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x10A84B: main (smbtree.c:342)
==3632==  Block was alloc'd at
==3632==    at 0x4C2FE45: calloc (vg_replace_malloc.c:711)
==3632==    by 0x773C79A: poptGetContext (in /usr/lib64/libpopt.so.0.0.0)
==3632==    by 0x10A829: main (smbtree.c:339)
==3632==

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14332
Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Apr  1 18:51:43 UTC 2020 on sn-devel-184

(cherry picked from commit 24b03fd28ed19cea8f875f96b3e300f808dfc4ae)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Fri Apr  3 12:24:36 UTC 2020 on sn-devel-184

source3/utils/smbtree.c

index 8e4caf0e80ba4c9698bca787352492c9a06564de..626279a96fd75c89268c8295f69aef7a70874b04 100644 (file)
@@ -339,7 +339,6 @@ int main(int argc, char *argv[])
        pc = poptGetContext("smbtree", argc, argv_const, long_options,
                            POPT_CONTEXT_KEEP_FIRST);
        while(poptGetNextOpt(pc) != -1);
-       poptFreeContext(pc);
        popt_burn_cmdline_password(argc, argv);
 
        /* Now do our stuff */