diff --git a/ChangeLog b/ChangeLog index 792d194a..e8aa7c9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Thu Jun 4 13:37:05 CEST 2015 + Fixing memory leak in digest authentication. -AW + Wed Jun 03 21:23:47 CEST 2015 Add deprecation compiler messages for deprecated functions and macros. -EG diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 4cc7f61b..e69f58aa 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c @@ -508,7 +508,10 @@ check_argument_match (struct MHD_Connection *connection, connection, argp); if (MHD_YES != test_header (connection, argp, NULL)) - return MHD_NO; + { + free(argb); + return MHD_NO; + } num_headers++; break; } @@ -527,10 +530,16 @@ check_argument_match (struct MHD_Connection *connection, connection, equals); if (! test_header (connection, argp, equals)) - return MHD_NO; + { + free(argb); + return MHD_NO; + } + num_headers++; argp = amper; } + + free(argb); /* also check that the number of headers matches */ for (pos = connection->headers_received; NULL != pos; pos = pos->next)