RPM Community Forums

Mailing List Message of <popt-devel>

Re: POPT's API has designed in memory leaks. What to do?

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 17 Jun 2010 - 16:09:37 CEST
Message-id: <BA33492D-489B-4D22-81F8-3226641CBFBA@mac.com>

On Jun 17, 2010, at 4:27 AM, Markdv wrote:

> 
> I just don't see why you wouldn't want to "fix" this. Seems like all you'd have to do is add
> 
>    con->os->nextArg = _free(con->os->nextArg);
> 
> to poptFreeContext(poptContext con) and be done with it.
> 

There's a double free with your suggested "fix" if/when the application
has also free'd the memory returned.

73 de Jeff
Received on Thu Jun 17 16:10:17 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.