summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-17 20:09:45 +0200
committerVolker Lendecke <vl@samba.org>2010-04-18 15:25:03 +0200
commit0264c0c337058c03f9b4aca915f6af5e6a7731b0 (patch)
tree56e594ad73b5066035d64b25a4e64fb1f42ed334
parent36e57fa728fc98102d3f40d4341d22e6beb3802a (diff)
downloadsamba-0264c0c337058c03f9b4aca915f6af5e6a7731b0.tar.gz
samba-0264c0c337058c03f9b4aca915f6af5e6a7731b0.tar.bz2
samba-0264c0c337058c03f9b4aca915f6af5e6a7731b0.zip
s3: Fix a memleak in discover_dc_netbios
-rw-r--r--source3/libsmb/dsgetdcname.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index 6e67e050fe..1e1eac33b3 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -497,6 +497,7 @@ static NTSTATUS discover_dc_netbios(TALLOC_CTX *mem_ctx,
dclist = TALLOC_ZERO_ARRAY(mem_ctx, struct ip_service_name, count);
if (!dclist) {
+ SAFE_FREE(iplist);
return NT_STATUS_NO_MEMORY;
}
@@ -512,6 +513,7 @@ static NTSTATUS discover_dc_netbios(TALLOC_CTX *mem_ctx,
r->port = iplist[i].port;
r->hostname = talloc_strdup(mem_ctx, addr);
if (!r->hostname) {
+ SAFE_FREE(iplist);
return NT_STATUS_NO_MEMORY;
}
@@ -519,6 +521,7 @@ static NTSTATUS discover_dc_netbios(TALLOC_CTX *mem_ctx,
*returned_dclist = dclist;
*returned_count = count;
+ SAFE_FREE(iplist);
return NT_STATUS_OK;
}