]> granicus.if.org Git - curl/commit
mem-include-scan: verify memory #includes
authorDaniel Stenberg <daniel@haxx.se>
Fri, 16 Nov 2012 23:59:42 +0000 (00:59 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 17 Nov 2012 12:56:38 +0000 (13:56 +0100)
commitee588fe088077785d9ad9263e03e1e525b074261
tree85aea44bd6e3354311ac0c60577c2d8bacf45445
parentdb4215f14a9ee2aca01315fa8cf100915284b15d
mem-include-scan: verify memory #includes

If we use memory functions (malloc, free, strdup etc) in C sources in
libcurl and we fail to include curl_memory.h or memdebug.h we either
fail to properly support user-provided memory callbacks or the memory
leak system of the test suite fails.

After Ajit's report of a failure in the first category in http_proxy.c,
I spotted a few in the second category as well. These problems are now
tested for by test 1132 which runs a perl program that scans for and
attempts to check that we use the correct include files if a memory
related function is used in the source code.

Reported by: Ajit Dhumale
Bug: http://curl.haxx.se/mail/lib-2012-11/0125.html
13 files changed:
lib/dict.c
lib/gopher.c
lib/http_proxy.c
lib/idn_win32.c
lib/md5.c
lib/non-ascii.c
lib/nwlib.c
lib/strdup.c
lib/strerror.c
tests/Makefile.am
tests/data/Makefile.am
tests/data/test1132 [new file with mode: 0644]
tests/mem-include-scan.pl [new file with mode: 0644]