void
evdns_close_server_port(struct evdns_server_port *port)
{
+ port->closing = 1;
if (--port->refcnt == 0)
server_port_free(port);
- port->closing = 1;
}
/* exported function */
return (0);
}
-/* Free all storage held by an evdns_server_port. Only called when */
+/* Free all storage held by an evdns_server_port. Only called when the
+ * reference count is down to 0. */
static void
server_port_free(struct evdns_server_port *port)
{
}
(void) event_del(&port->event);
CLEAR(&port->event);
- /* XXXX021 actually free the port? -NM */
- /* XXXX yes, and fix up evdns_close_server_port to dtrt. -NM */
+ CLEAR(port);
+ free(port);
}
/* exported function */