aboutsummaryrefslogtreecommitdiff
path: root/lib/memdebug.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-10-28 20:30:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-10-28 20:30:23 +0000
commit6a79b0e8591ec94adcc49809bf1ab8cf66f1bb41 (patch)
treeb1b8b301d39caaee4e22277b84fbc52545d03b5d /lib/memdebug.c
parent0d9f14f5c17e4a3888dedbc8d568a55979fc05f0 (diff)
downloadgnurl-6a79b0e8591ec94adcc49809bf1ab8cf66f1bb41.tar.gz
gnurl-6a79b0e8591ec94adcc49809bf1ab8cf66f1bb41.tar.bz2
gnurl-6a79b0e8591ec94adcc49809bf1ab8cf66f1bb41.zip
Since the NSS lib closes the socket the memory tracking system wrongly gets a
false positive on a leaked socket, so this introduces a way to tell the system that the socket is indeed closed without explicitly closing it!
Diffstat (limited to 'lib/memdebug.c')
-rw-r--r--lib/memdebug.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/memdebug.c b/lib/memdebug.c
index 3a0cf7153..ea3eb8559 100644
--- a/lib/memdebug.c
+++ b/lib/memdebug.c
@@ -263,13 +263,19 @@ int curl_accept(int s, void *saddr, void *saddrlen,
return sockfd;
}
-/* this is our own defined way to close sockets on *ALL* platforms */
-int curl_sclose(int sockfd, int line, const char *source)
+/* separate function to allow libcurl to mark a "faked" close */
+int curl_mark_sclose(int sockfd, int line, const char *source)
{
- int res=sclose(sockfd);
if(logfile)
fprintf(logfile, "FD %s:%d sclose(%d)\n",
source, line, sockfd);
+}
+
+/* this is our own defined way to close sockets on *ALL* platforms */
+int curl_sclose(int sockfd, int line, const char *source)
+{
+ int res=sclose(sockfd);
+ curl_mark_sclose(sockfd, line, source);
return res;
}