summaryrefslogtreecommitdiff
path: root/lib/addns
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-04-21 17:35:37 -0700
committerVolker Lendecke <vl@samba.org>2016-04-22 07:20:17 +0200
commitd2e143708ff336894b65f413adc71a5990dc9995 (patch)
tree2bb4ff748aafa7f5d4dfccc6253df511356455fe /lib/addns
parent773a16ba86482d0f1fcc9f3f147e512adba2f2e3 (diff)
downloadsamba-d2e143708ff336894b65f413adc71a5990dc9995.tar.gz
lib: dns: Clean up allocated structure on error exit.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org>
Diffstat (limited to 'lib/addns')
-rw-r--r--lib/addns/dnsgss.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/addns/dnsgss.c b/lib/addns/dnsgss.c
index f7ed1d17d50..fd1af7ec5ba 100644
--- a/lib/addns/dnsgss.c
+++ b/lib/addns/dnsgss.c
@@ -89,6 +89,8 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
struct gss_buffer_desc_struct input_desc, *input_ptr, output_desc;
OM_uint32 major, minor;
OM_uint32 ret_flags;
+ struct dns_request *req = NULL;
+ struct dns_buffer *buf = NULL;
DNS_ERROR err;
gss_OID_desc krb5_oid_desc =
@@ -112,9 +114,7 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
if (output_desc.length != 0) {
- struct dns_request *req;
struct dns_rrec *rec;
- struct dns_buffer *buf;
time_t t = time(NULL);
@@ -143,12 +143,13 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
if (!ERR_DNS_IS_OK(err)) goto error;
- err = dns_marshall_request(req, req, &buf);
+ err = dns_marshall_request(mem_ctx, req, &buf);
if (!ERR_DNS_IS_OK(err)) goto error;
err = dns_send(conn, buf);
if (!ERR_DNS_IS_OK(err)) goto error;
+ TALLOC_FREE(buf);
TALLOC_FREE(req);
}
@@ -162,7 +163,6 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
if (major == GSS_S_CONTINUE_NEEDED) {
struct dns_request *resp;
- struct dns_buffer *buf;
struct dns_tkey_record *tkey;
struct dns_rrec *tkey_answer = NULL;
uint16_t i;
@@ -210,6 +210,8 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
error:
+ TALLOC_FREE(buf);
+ TALLOC_FREE(req);
return err;
}