Skip to content
Snippets Groups Projects
Commit 21c4cd7c authored by Matt Johnston's avatar Matt Johnston
Browse files

add a missing freeaddrinfo()

--HG--
extra : convert_revision : 861515d7429c76542803c49a1fc972cba6a760b4
parent 5a640471
No related merge requests found
...@@ -186,6 +186,10 @@ int dropbear_listen(const char* address, const char* port, ...@@ -186,6 +186,10 @@ int dropbear_listen(const char* address, const char* port,
*errstring = (char*)m_malloc(len); *errstring = (char*)m_malloc(len);
snprintf(*errstring, len, "Error resolving: %s", gai_strerror(err)); snprintf(*errstring, len, "Error resolving: %s", gai_strerror(err));
} }
if (res0) {
freeaddrinfo(res0);
res0 = NULL;
}
TRACE(("leave dropbear_listen: failed resolving")) TRACE(("leave dropbear_listen: failed resolving"))
return -1; return -1;
} }
...@@ -237,6 +241,11 @@ int dropbear_listen(const char* address, const char* port, ...@@ -237,6 +241,11 @@ int dropbear_listen(const char* address, const char* port,
nsock++; nsock++;
} }
if (res0) {
freeaddrinfo(res0);
res0 = NULL;
}
if (nsock == 0) { if (nsock == 0) {
if (errstring != NULL && *errstring == NULL) { if (errstring != NULL && *errstring == NULL) {
int len; int len;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment