summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dbutil.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dbutil.c b/dbutil.c
index 45c720e..84fa3ab 100644
--- a/dbutil.c
+++ b/dbutil.c
@@ -186,6 +186,10 @@ int dropbear_listen(const char* address, const char* port,
*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 @@ int dropbear_listen(const char* address, const char* port,
nsock++;
}
+ if (res0) {
+ freeaddrinfo(res0);
+ res0 = NULL;
+ }
+
if (nsock == 0) {
if (errstring != NULL && *errstring == NULL) {
int len;