From ee588fe088077785d9ad9263e03e1e525b074261 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 17 Nov 2012 00:59:42 +0100 Subject: 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 --- lib/non-ascii.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/non-ascii.c') diff --git a/lib/non-ascii.c b/lib/non-ascii.c index a38680cc1..8e29227c0 100644 --- a/lib/non-ascii.c +++ b/lib/non-ascii.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -24,12 +24,16 @@ #ifdef CURL_DOES_CONVERSIONS +#include + #include "non-ascii.h" #include "formdata.h" #include "sendf.h" #include "urldata.h" -#include +#include "curl_memory.h" +/* The last #include file should be: */ +#include "memdebug.h" #ifdef HAVE_ICONV #include -- cgit v1.2.3