cURL / Mailing Lists / curl-library / Single Mail

curl-library

memlimit fail

From: Gisle Vanem <giva_at_bgnett.no>
Date: Sat, 05 Feb 2005 14:54:24 +0100

I was playing around with the $CURL_MEMLIMIT setting and
found a situation where "out of memory" was replaced with an
"empty reply from server". E.g.

set curl_memlimit=65
curl_memdebug=.\memdump
curl -vk -otest.ssl https://www.vg.no
..
curl: (27) Empty reply from server

>From memdump:

MEM .\http.c:801 malloc(12) = 0xc1f028
LIMIT .\mprintf.c:1036 3 ALLOCS left
MEM .\mprintf.c:1036 malloc(32) = 0xc1f070
LIMIT .\mprintf.c:1047 2 ALLOCS left
MEM .\mprintf.c:1047 realloc(0xc1f070, 64) = 0xc1f070
LIMIT .\mprintf.c:1047 1 ALLOCS left
MEM .\mprintf.c:1047 realloc(0xc1f070, 128) = 0xc1f070
LIMIT .\mprintf.c:1047 0 ALLOCS left
MEM .\mprintf.c:1047 realloc(0xc1f070, 256) = 0xc1f070
LIMIT .\http.c:944 malloc reached memlimit
MEM .\http.c:916 free(0xc1f070)
MEM .\http.c:923 free(0xc1f028)

Looks like Curl_http_done() is not smart enough. Shouldn't it
remember the CURLE_OUT_OF_MEMORY from add_buffer()?

--gv
Received on 2005-02-05