GNOME Bugzilla – Bug 705188
Leaked Resource in nanohttp.c
Last modified: 2013-09-30 02:55:32 UTC
In File: https://git.gnome.org/browse/libxml2/tree/nanohttp.c Lines: 1001 to 1007 if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char *) &status, &len) < 0) { /* Solaris error code */ __xmlIOErr(XML_FROM_HTTP, 0, "getsockopt failed\n"); return INVALID_SOCKET; This will cause memory leak as function returns and socket is still open. Fix: if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char *) &status, &len) < 0) { /* Solaris error code */ __xmlIOErr(XML_FROM_HTTP, 0, "getsockopt failed\n"); closesocket(s); return INVALID_SOCKET;
Created attachment 250923 [details] [review] Use same behaviour on Solaris platform as we used on other platforms
Ah, indeed, that's bad, patch applied: https://git.gnome.org/browse/libxml2/commit/?id=283c83e0d3bca73b61c1d116c05fe4ccaa96ec04 that specific piece of code is a mess, thanks Denis for providing the patch ! Daniel