Skip to content

Commit 93b980e

Browse files
carenasgitster
authored andcommitted
http: use xmalloc with cURL
f0ed822 (Add custom memory allocator to MinGW and MacOS builds, 2009-05-31) never told cURL about it. Correct that by using the cURL initializer available since version 7.12 to point to xmalloc and friends for consistency which then will pass the allocation requests along when USE_NED_ALLOCATOR=YesPlease is used (most likely in Windows) Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9827d4c commit 93b980e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

http.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@
2525
#if LIBCURL_VERSION_NUM < 0x070704
2626
#define curl_global_cleanup() do { /* nothing */ } while (0)
2727
#endif
28+
2829
#if LIBCURL_VERSION_NUM < 0x070800
2930
#define curl_global_init(a) do { /* nothing */ } while (0)
31+
#elif LIBCURL_VERSION_NUM >= 0x070c00
32+
#define curl_global_init(a) curl_global_init_mem(a, xmalloc, free, \
33+
xrealloc, xstrdup, xcalloc)
3034
#endif
3135

3236
#if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)

0 commit comments

Comments
 (0)