[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] memleak in digestauth.c @ check_argument_match()
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] memleak in digestauth.c @ check_argument_match() |
Date: |
Thu, 04 Jun 2015 13:42:37 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 |
Thanks, fixed as suggested in SVN 35864 (and yes, very odd that this
wasn't caught by static analysis or other runs with valgrind before).
-Christian
On 06/04/2015 01:22 PM, Andreas Wehrmann wrote:
> Hi!
>
> I was checking a test app in valgrind and much to my surprise it was
> complaining about a memleak in libmicrohttpd.
> In check_argument_match() a buffer is allocated using strdup() but freed
> nowhere.
>
> I wouldn't have noticed this leak if it wasn't for valgrind because if a URI
> is requested without any arguments (my usual case)
> the buffer that gets allocated has 'only' a length of 1 byte, thus memory
> usage will build up very slowly over time.
>
> The patch attached fixes it.
> Btw. the indentation of that file is a mess, tabs and spaces are mixed :-|
>
> Regards,
> Andreas
>
0xE29FC3CC.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature