Merge pull request #294 from devnexen/addrinfo_leak_fix

- Fix addrinfo leaks.
This commit is contained in:
Yamagi 2018-05-01 15:29:06 +02:00 committed by GitHub
commit 3adb4a62d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -436,6 +436,8 @@ NET_StringToSockaddr(const char *s, struct sockaddr_storage *sadr)
return 0; return 0;
} }
freeaddrinfo(resultp);
return true; return true;
} }
@ -706,6 +708,7 @@ NET_SendPacket(netsrc_t sock, int length, void *data, netadr_t to)
/* sockaddr_in6 should now have a valid scope_id. */ /* sockaddr_in6 should now have a valid scope_id. */
memcpy(s6, res->ai_addr, res->ai_addrlen); memcpy(s6, res->ai_addr, res->ai_addrlen);
freeaddrinfo(res);
} }
else else
{ {