]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- A memory leak in the minires_nsendsigned() function call was repaired.
authorDavid Hankins <dhankins@isc.org>
Tue, 27 Mar 2007 03:08:13 +0000 (03:08 +0000)
committerDavid Hankins <dhankins@isc.org>
Tue, 27 Mar 2007 03:08:13 +0000 (03:08 +0000)
  Effectively, this leaked ~80 bytes per DDNS update.  [ISC-Bugs #16770]

RELNOTES
minires/res_sendsigned.c

index f7695797aaa63fac3bef087f0bee62c0048510fd..f44956cfba92e1e823994bcaf3b860982282f85f 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -195,6 +195,9 @@ the README file.
 
 - A reference leak on binding scopes set by ddns updates was repaired.
 
+- A memory leak in the minires_nsendsigned() function call was repaired.
+  Effectively, this leaked ~80 bytes per DDNS update.
+
                         Changes since 3.0.5rc1
 
 - A bug was repaired in fixes to the dhclient, which sought to run the
index 2404542147425437a5c9eeec93f4ae78f4624bb2..b80ffe5143e5bdc3636f8710185859f4027b260d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -67,8 +67,10 @@ res_nsendsigned(res_state statp,
 
        bufsize = msglen + 1024;
        newmsg = (double *) malloc(bufsize);
-       if (newmsg == NULL)
+       if (newmsg == NULL) {
+               free(nstatp);
                return ISC_R_NOMEMORY;
+       }
        memcpy(newmsg, msg, msglen);
        newmsglen = msglen;
 
@@ -91,6 +93,7 @@ res_nsendsigned(res_state statp,
                        NOERROR, dstkey, NULL, 0,
                        sig, &siglen, 0);
        if (rcode != ISC_R_SUCCESS) {
+               dst_free_key(dstkey);
                free (nstatp);
                free (newmsg);
                return rcode;
@@ -107,6 +110,7 @@ retry:
 
        rcode = res_nsend(nstatp, newmsg, newmsglen, answer, anslen, &ret);
        if (rcode != ISC_R_SUCCESS) {
+               dst_free_key(dstkey);
                free (nstatp);
                free (newmsg);
                return rcode;
@@ -119,6 +123,7 @@ retry:
        if (rcode != ISC_R_SUCCESS) {
                Dprint(nstatp->pfcode & RES_PRF_REPLY,
                       (stdout, ";; TSIG invalid (%s)\n", p_rcode(ret)));
+               dst_free_key(dstkey);
                free (nstatp);
                free (newmsg);
                return rcode;
@@ -132,6 +137,7 @@ retry:
                goto retry;
        }
 
+       dst_free_key(dstkey);
        free (nstatp);
        free (newmsg);
        *anssize = anslen;