mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-23 01:12:59 +08:00
fix memory leak
don't leak variable 'space' when the host is numeric Signed-off-by: Antonio Quartulli <a@unstable.cc>
This commit is contained in:
parent
bb3df1e440
commit
46647bee44
@ -830,7 +830,10 @@ int proxy_getaddrinfo(const char *node, const char *service, const struct addrin
|
|||||||
if(node && !inet_aton(node, &((struct sockaddr_in *) &space->sockaddr_space)->sin_addr)) {
|
if(node && !inet_aton(node, &((struct sockaddr_in *) &space->sockaddr_space)->sin_addr)) {
|
||||||
/* some folks (nmap) use getaddrinfo() with AI_NUMERICHOST to check whether a string
|
/* some folks (nmap) use getaddrinfo() with AI_NUMERICHOST to check whether a string
|
||||||
containing a numeric ip was passed. we must return failure in that case. */
|
containing a numeric ip was passed. we must return failure in that case. */
|
||||||
if(hints && (hints->ai_flags & AI_NUMERICHOST)) return EAI_NONAME;
|
if(hints && (hints->ai_flags & AI_NUMERICHOST)) {
|
||||||
|
free(space);
|
||||||
|
return EAI_NONAME;
|
||||||
|
}
|
||||||
hp = proxy_gethostbyname(node, &ghdata);
|
hp = proxy_gethostbyname(node, &ghdata);
|
||||||
if(hp)
|
if(hp)
|
||||||
memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr,
|
memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr,
|
||||||
|
Loading…
Reference in New Issue
Block a user