cURL / Mailing Lists / curl-library / Single Mail


Leak when destination not reachable

From: vikram <>
Date: Mon, 18 Jun 2007 22:24:47 +0530

Hello All,

I'm using curl version 7.15.1

My code contains normal curl calls to communicate with the server.
Everything works good and there are no leaks if server is reachable. But
in case server could not be reached then for each connection there is
leak of around 4KBs. I tried debugging this using --enable-debug and
curl_memdebug() API.
Attached is the generated output file for this scenario which shows 9000
bytes lost in hostip4.c:217. Code here seems to have proper free() calls
to deallocate it.

Any details on this issue are welcome. Also I'm interested to know if
this issue has been resolved in the latest version of curl.


MEM url.c:289 calloc(1,33692) = 0x3ceec
MEM url.c:305 malloc(256) = 0x372b4
MEM url.c:348 malloc(20) = 0x36d0c
MEM sendf.c:95 malloc(8) = 0x36d34
MEM sendf.c:97 strdup(0x15640) (8) = 0x373c4
MEM sendf.c:95 malloc(8) = 0x373dc
MEM sendf.c:97 strdup(0x15648) (23) = 0x373f4
MEM sendf.c:95 malloc(8) = 0x3741c
MEM sendf.c:97 strdup(0x16690) (1) = 0x37434
MEM multi.c:150 malloc(48) = 0x3744c
MEM hash.c:96 malloc(16) = 0x3748c
MEM hash.c:74 malloc(28) = 0x374ac
MEM llist.c:49 malloc(16) = 0x374dc
MEM llist.c:49 malloc(16) = 0x374fc
MEM llist.c:49 malloc(16) = 0x3751c
MEM llist.c:49 malloc(16) = 0x3753c
MEM llist.c:49 malloc(16) = 0x3755c
MEM llist.c:49 malloc(16) = 0x3757c
MEM llist.c:49 malloc(16) = 0x3759c
MEM multi.c:183 malloc(32) = 0x375bc
MEM sslgen.c:508 calloc(68,5) = 0x2f044
MEM cookie.c:665 calloc(1,20) = 0x2f1ac
MEM cookie.c:668 strdup(0x37434) (1) = 0x2f1d4
MEM sendf.c:134 free(0x37434)
MEM sendf.c:136 free(0x3741c)
MEM url.c:2326 calloc(892,1) = 0x2e474
MEM url.c:2387 malloc(258) = 0x2f1ec
MEM url.c:2392 malloc(258) = 0x2e804
MEM url.c:3319 strdup(0xbeddae54) (14) = 0x3741c
MEM url.c:3320 strdup(0xbeddad54) (18) = 0x2f304
MEM sslgen.c:103 strdup(0x4005e240) (32) = 0x2e91c
MEM mprintf.c:1039 malloc(32) = 0x2e94c
MEM hostip.c:406 free(0x2e94c)
MEM hostip4.c:217 calloc(9000,1) = 0x2fb74
MEM url.c:184 free(0x2f1ec)
MEM url.c:184 free(0x2e804)
MEM url.c:184 free(0x3741c)
MEM url.c:184 free(0x2f304)
MEM sslgen.c:138 free(0x2e91c)
MEM url.c:1575 free(0x2e474)
MEM multi.c:705 malloc(16) = 0x3741c
MEM sendf.c:95 malloc(8) = 0x2f1ec
MEM sendf.c:97 strdup(0x15630) (15) = 0x2f204
MEM multi.c:258 free(0x3741c)
MEM multi.c:259 free(0x375bc)
MEM sslgen.c:345 free(0x2f044)
MEM url.c:184 free(0x372b4)
MEM cookie.c:833 free(0x2f1d4)
MEM cookie.c:841 free(0x2f1ac)
MEM url.c:259 free(0x36d0c)
MEM url.c:272 free(0x3ceec)
MEM llist.c:130 free(0x374dc)
MEM llist.c:130 free(0x374fc)
MEM llist.c:130 free(0x3751c)
MEM llist.c:130 free(0x3753c)
MEM llist.c:130 free(0x3755c)
MEM llist.c:130 free(0x3757c)
MEM llist.c:130 free(0x3759c)
MEM hash.c:229 free(0x374ac)
MEM hash.c:264 free(0x3748c)
MEM multi.c:757 free(0x3744c)
MEM sendf.c:134 free(0x373c4)
MEM sendf.c:136 free(0x36d34)
MEM sendf.c:134 free(0x373f4)
MEM sendf.c:136 free(0x373dc)
MEM sendf.c:134 free(0x2f204)
MEM sendf.c:136 free(0x2f1ec)
Received on 2007-06-18