changeset 239:e5ad9fa8b1fa

add a missing freeaddrinfo()
author Matt Johnston <matt@ucc.asn.au>
date Mon, 05 Sep 2005 12:12:55 +0000
parents e923801a7678
children 581f81e8c50c
files dbutil.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dbutil.c	Fri Sep 02 15:35:18 2005 +0000
+++ b/dbutil.c	Mon Sep 05 12:12:55 2005 +0000
@@ -186,6 +186,10 @@
 			*errstring = (char*)m_malloc(len);
 			snprintf(*errstring, len, "Error resolving: %s", gai_strerror(err));
 		}
+		if (res0) {
+			freeaddrinfo(res0);
+			res0 = NULL;
+		}
 		TRACE(("leave dropbear_listen: failed resolving"))
 		return -1;
 	}
@@ -237,6 +241,11 @@
 		nsock++;
 	}
 
+	if (res0) {
+		freeaddrinfo(res0);
+		res0 = NULL;
+	}
+
 	if (nsock == 0) {
 		if (errstring != NULL && *errstring == NULL) {
 			int len;