diff dbutil.c @ 242:3311f4aa52cb

merge of da30137eaac417f50a323f9ddd29999ec21261e0 and fb45ddf51e20f0ff007eb8abc737de3c024f45cc
author Matt Johnston <matt@ucc.asn.au>
date Mon, 05 Sep 2005 15:16:52 +0000
parents c5d3ef11155f e5ad9fa8b1fa
children b02e8eef3c3a
line wrap: on
line diff
--- a/dbutil.c	Mon Sep 05 15:16:10 2005 +0000
+++ b/dbutil.c	Mon Sep 05 15:16:52 2005 +0000
@@ -190,6 +190,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;
 	}
@@ -241,6 +245,11 @@
 		nsock++;
 	}
 
+	if (res0) {
+		freeaddrinfo(res0);
+		res0 = NULL;
+	}
+
 	if (nsock == 0) {
 		if (errstring != NULL && *errstring == NULL) {
 			int len;