aboutsummaryrefslogtreecommitdiff
path: root/lib/md5.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-11-17 00:59:42 +0100
committerDaniel Stenberg <daniel@haxx.se>2012-11-17 13:56:38 +0100
commitee588fe088077785d9ad9263e03e1e525b074261 (patch)
tree85aea44bd6e3354311ac0c60577c2d8bacf45445 /lib/md5.c
parentdb4215f14a9ee2aca01315fa8cf100915284b15d (diff)
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
Diffstat (limited to 'lib/md5.c')
-rw-r--r--lib/md5.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/md5.c b/lib/md5.c
index 8e580d8e4..ae5812b95 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -28,9 +28,13 @@
#include "curl_hmac.h"
#include "warnless.h"
+#include "curl_memory.h"
+
#if defined(USE_GNUTLS_NETTLE)
#include <nettle/md5.h>
+/* The last #include file should be: */
+#include "memdebug.h"
typedef struct md5_ctx MD5_CTX;
@@ -54,6 +58,8 @@ static void MD5_Final(unsigned char digest[16], MD5_CTX * ctx)
#elif defined(USE_GNUTLS)
#include <gcrypt.h>
+/* The last #include file should be: */
+#include "memdebug.h"
typedef gcry_md_hd_t MD5_CTX;
@@ -436,6 +442,9 @@ static void Decode (UINT4 *output,
#endif /* CRYPTO LIBS */
+/* The last #include file should be: */
+#include "memdebug.h"
+
const HMAC_params Curl_HMAC_MD5[] = {
{
(HMAC_hinit_func) MD5_Init, /* Hash initialization function. */