torture: fix mem leak found by ASAN (smb2_scan)
[garming/samba-autobuild/.git] / source4 / torture / smb2 / scan.c
index 3e43b9dfa32b8f531594c5e616ed38a5e7e79905..adb7fdb7f1aeee95df1f4993fb53e49bcf56e430 100644 (file)
@@ -200,7 +200,7 @@ static bool torture_smb2_find_scan(struct torture_context *tctx)
 */
 static bool torture_smb2_scan(struct torture_context *tctx)
 {
-       TALLOC_CTX *mem_ctx = talloc_new(NULL);
+       TALLOC_CTX *mem_ctx = talloc_new(tctx);
        struct smb2_tree *tree;
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);