mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 13:04:23 -04:00
r15249@tombo: nickm | 2008-04-18 09:46:02 -0400
Avoid leaking a string in the unlikely OOM case from name_from_addr. spotted by niels. svn:r724
This commit is contained in:
parent
a404bf9877
commit
a55a67d56e
5
http.c
5
http.c
@ -2275,8 +2275,11 @@ evhttp_get_request_connection(
|
|||||||
char *hostname = NULL, *portname = NULL;
|
char *hostname = NULL, *portname = NULL;
|
||||||
|
|
||||||
name_from_addr(sa, salen, &hostname, &portname);
|
name_from_addr(sa, salen, &hostname, &portname);
|
||||||
if (hostname==NULL || portname==NULL)
|
if (hostname==NULL || portname==NULL) {
|
||||||
|
if (hostname) event_free(hostname);
|
||||||
|
if (portname) event_free(portname);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
event_debug(("%s: new request from %s:%s on %d\n",
|
event_debug(("%s: new request from %s:%s on %d\n",
|
||||||
__func__, hostname, portname, fd));
|
__func__, hostname, portname, fd));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user