curl-library
Crash/memory leak in http_proxy.c when custom memory manager callbacks are used
From: Ajit Dhumale <ajitd_at_gslab.com>
Date: Tue, 13 Nov 2012 05:54:25 +0530 (IST)
Received on 2012-11-15
Date: Tue, 13 Nov 2012 05:54:25 +0530 (IST)
Hello,
While investigating a memory leak, I observed that ‘http_proxy.c’ calls ‘free’ but does not include ‘curl_memory.h’. When a custom memory manager is used (using curl_global_init_mem), memory allocation is done using the custom memory manager callbacks but ‘free’ in http_proxy.c still uses the default ‘free’ function. This could lead to either a crash or memory leak. I am attaching a patch which fixed the memory leak I observed.
Best regards,
Ajit Dhumale
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/x-patch attachment: http_proxy_c.diff