diff options
author | Volker Lendecke <vl@samba.org> | 2012-05-24 15:59:32 +0200 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2012-05-30 00:37:53 +0200 |
commit | 577a065f216a7d434082eded84c0642e7adff043 (patch) | |
tree | bda24088a5c29a5ee80657819a2f5a6a85618e64 | |
parent | 1bdaf4b31b6e9dac92e70ff8e34a20984e235888 (diff) | |
download | samba-577a065f216a7d434082eded84c0642e7adff043.tar.gz samba-577a065f216a7d434082eded84c0642e7adff043.tar.bz2 samba-577a065f216a7d434082eded84c0642e7adff043.zip |
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>
-rw-r--r-- | source4/dns_server/dns_server.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c index f9db095e74..28c57c0f6e 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); |