summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-05-24 15:59:32 +0200
committerKai Blin <kai@samba.org>2012-05-30 00:37:53 +0200
commit577a065f216a7d434082eded84c0642e7adff043 (patch)
treebda24088a5c29a5ee80657819a2f5a6a85618e64 /source4/dns_server
parent1bdaf4b31b6e9dac92e70ff8e34a20984e235888 (diff)
downloadsamba-577a065f216a7d434082eded84c0642e7adff043.tar.gz
s4-dns: Fix an unlikely potential memleak
If state was alloc'ed to NULL, in_packet to != NULL and out_packet to NULL, we leak in_packet. Signed-off-by: Kai Blin <kai@samba.org>
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dns_server.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c
index f9db095e744..28c57c0f6eb 100644
--- a/source4/dns_server/dns_server.c
+++ b/source4/dns_server/dns_server.c
@@ -117,8 +117,10 @@ static NTSTATUS dns_process(struct dns_server *dns,
/* TODO: We don't really need an out_packet. */
out_packet = talloc_zero(state, struct dns_name_packet);
- if (in_packet == NULL) return NT_STATUS_NO_MEMORY;
- if (out_packet == NULL) return NT_STATUS_NO_MEMORY;
+ if ((state == NULL) || (in_packet == NULL) || (out_packet == NULL)) {
+ TALLOC_FREE(state);
+ return NT_STATUS_NO_MEMORY;
+ }
dump_data(8, in->data, in->length);