s3/libsmb: cleanup discover_dc_dns() Fix potential leak
authorNoel Power <noel.power@suse.com>
Thu, 10 Sep 2020 15:37:08 +0000 (16:37 +0100)
committerNoel Power <npower@samba.org>
Tue, 15 Sep 2020 10:09:37 +0000 (10:09 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/dsgetdcname.c

index 42db03ac52c5ecced7d6f06ea9f4cc68a7000465..4d037984fc8b992205672657be1769a9bedf7283 100644 (file)
@@ -786,6 +786,9 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx,
                return NT_STATUS_OK;
        }
 
+       TALLOC_FREE(dcs);
+       TALLOC_FREE(dclist);
+       TALLOC_FREE(dns_lookups);
        return NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
 }