s3:pylibsmb: Free async .list() memory
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 11 Dec 2018 23:23:42 +0000 (12:23 +1300)
committerTim Beale <timbeale@samba.org>
Mon, 7 Jan 2019 00:23:08 +0000 (01:23 +0100)
finfos was being allocated but never freed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/libsmb/pylibsmb.c

index 64da389..156352d 100644 (file)
@@ -987,9 +987,12 @@ static NTSTATUS do_listing(struct py_cli_state *self,
                status = callback_fn(base_dir, &finfos[i], user_mask,
                                     priv);
                if (!NT_STATUS_IS_OK(status)) {
+                       TALLOC_FREE(finfos);
                        return status;
                }
        }
+
+       TALLOC_FREE(finfos);
        return status;
 }