This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] c-exp.y, memory leak


>>> Date: Sat, 4 Aug 2007 18:51:09 -0700 (PDT)
>>> From: msnyder@sonic.net
>>>
>>> 2007-08-04  Michael Snyder  <msnyder@access-company.com>
>>>
>>> 	* c-exp.y (parse_number): Memory leak.
>>
>> Shouldn't this use xfree()?
>
> Actually, although arguably they should -- I'm not so sure.
>
> It's kind of a mess -- c-exp.y uses malloc, and then Makefile.in
> runs sed on c-exp.c to transform malloc to xmalloc.  No such sed
> transform is done to convert free to xfree, and there is at least
> one other call to free in there that does not get converted.
>
> I'm reluctant to mess with the sed scripts.  "free" is just too
> common a string.

Alright -- I'm going to commit this using "free" rather than
"xfree", on the premise that the file already calls free once,
and doesn't call xfree at all.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]