From: Ryan Bloom Date: Sun, 7 Jan 2001 05:51:23 +0000 (+0000) Subject: Stop leaking sockets. This is a minimal leak, but it was there. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0c66cd81cdf894239e8785e0a8f5140b1fc7ad8;p=apache Stop leaking sockets. This is a minimal leak, but it was there. Basically, we were creating a socket_t, but never assigning a port or IP address to it. We then re-read the config file, and search the list of allocated sockets for the socket that we have already allocated for this port, but we never find the port and address, because we never stored them in the socket_t. This was keeping the Listen directive from working properly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87601 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/listen.c b/server/listen.c index 440a50558f..dc805095a7 100644 --- a/server/listen.c +++ b/server/listen.c @@ -252,6 +252,9 @@ static void alloc_listener(process_rec *process, char *addr, apr_port_t port) "alloc_listener: failed to get a socket for %s", addr); return; } + apr_get_sockaddr(&sa, APR_LOCAL, new->sd); + apr_set_port(sa, port); + apr_set_ipaddr(sa, addr); new->next = ap_listeners; ap_listeners = new; }