From: Nick Mathewson Date: Fri, 18 Apr 2008 13:46:13 +0000 (+0000) Subject: r15249@tombo: nickm | 2008-04-18 09:46:02 -0400 X-Git-Tag: release-2.0.1-alpha~369 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a55a67d56e989b9f7fa2027f2c75bec8a55a9a87;p=libevent 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 --- diff --git a/http.c b/http.c index efd9f7b7..b9f33882 100644 --- a/http.c +++ b/http.c @@ -2275,8 +2275,11 @@ evhttp_get_request_connection( char *hostname = NULL, *portname = NULL; 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); + } event_debug(("%s: new request from %s:%s on %d\n", __func__, hostname, portname, fd));