]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2301. [bug] Remove resource leak and fix error messages in
authorMark Andrews <marka@isc.org>
Mon, 14 Jan 2008 12:02:11 +0000 (12:02 +0000)
committerMark Andrews <marka@isc.org>
Mon, 14 Jan 2008 12:02:11 +0000 (12:02 +0000)
                        bin/tests/system/lwresd/lwtest.c. [RT #17474]

CHANGES
bin/tests/system/lwresd/lwtest.c

diff --git a/CHANGES b/CHANGES
index dccd058aa9b492984444d6840e8ce41aa8709f15..5bf601d6ed8e873444668c9b5b9c626603e01ae3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2301.  [bug]           Remove resource leak and fix error messages in
+                       bin/tests/system/lwresd/lwtest.c. [RT #17474]
+
 2300.  [bug]           Fixed failure to close open file in 
                        bin/tests/names/t_names.c. [RT #17473]
 
index 263acb399416ab78d2830caa2ca56e4ec5e78b1c..47369af07f9247a9a3ab5a304d49a4f548351ead 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwtest.c,v 1.29 2007/09/13 04:45:18 each Exp $ */
+/* $Id: lwtest.c,v 1.30 2008/01/14 12:02:11 marka Exp $ */
 
 #include <config.h>
 
@@ -350,6 +350,7 @@ test_getipnodebyname(const char *name, const char *address, int af,
                if (hp->h_addrtype != af) {
                        printf("I:getipnodebyname(%s) returned wrong family\n",
                               name);
+                       freehostent(hp);
                        fails++;
                        return;
                }
@@ -361,6 +362,7 @@ test_getipnodebyname(const char *name, const char *address, int af,
                                        outbuf, sizeof(outbuf));
                        printf("I:getipnodebyname(%s) returned %s, "
                               "expected %s\n", name, outbuf, address);
+                       freehostent(hp);
                        fails++;
                        return;
                }
@@ -427,20 +429,21 @@ test_getipnodebyaddr(const char *address, int af, const char *name) {
                if (name == NULL && error_num == HOST_NOT_FOUND)
                        return;
                else if (error_num != HOST_NOT_FOUND) {
-                       printf("I:gethostbyaddr(%s) failed: %d\n",
+                       printf("I:getipnodebyaddr(%s) failed: %d\n",
                               address, error_num);
                        fails++;
                        return;
                } else {
-                       printf("I:gethostbyaddr(%s) returned not found\n",
+                       printf("I:getipnodebyaddr(%s) returned not found\n",
                               address);
                        fails++;
                        return;
                }
        } else {
                if (strcmp(hp->h_name, name) != 0) {
-                       printf("I:gethostbyname(%s) returned %s, "
+                       printf("I:getipnodebyaddr(%s) returned %s, "
                               "expected %s\n", address, hp->h_name, name);
+                       freehostent(hp);
                        fails++;
                        return;
                }
@@ -588,12 +591,12 @@ test_getnameinfo(const char *address, int af, const char *name) {
                }
        } else {
                if (name == NULL) {
-                       printf("I:getaddrinfo(%s) returned %s, "
+                       printf("I:getnameinfo(%s) returned %s, "
                               "expected NULL\n", address, host);
                        fails++;
                        return;
                } else if (strcmp(host, name) != 0) {
-                       printf("I:getaddrinfo(%s) returned %s, expected %s\n",
+                       printf("I:getnameinfo(%s) returned %s, expected %s\n",
                               address, host, name);
                        fails++;
                        return;