s3:utils/profiles fix a use after free
authorChristian Ambach <ambi@samba.org>
Tue, 4 Nov 2014 22:51:23 +0000 (23:51 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Dec 2014 20:30:06 +0000 (21:30 +0100)
path is a talloc-child of subkeys, so subkeys should not be freed before calling
verbose_output

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Dec  3 00:43:19 CET 2014 on sn-devel-104

(cherry picked from commit 3b90bfb1089e6a4b7e05e7ed62bb642521f57917)

source3/utils/profiles.c

index 30c6ad0a1fb9dc2b6c47381cb2ea6fd7152b2291..a88469a919269a7751d52605e1b163c3537d3235 100644 (file)
@@ -182,12 +182,12 @@ static bool copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
                }
        }
 
-       /* values is a talloc()'d child of subkeys here so just throw it all away */
-
-       TALLOC_FREE( subkeys );
 
        verbose_output("[%s]\n", path);
 
+       /* values is a talloc()'d child of subkeys here so just throw it all away */
+       TALLOC_FREE(subkeys);
+
        return True;
 }