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] |
On Friday 26 March 2010 01:55:50, Stan Shebs wrote:It was leaking before. :-) It needs to stick around indefinitely; it guess it would work to free an old one just before allocating a new one.
The error message is never NULL, I added the MI status bit overlooked before,
But now, `error_desc' is leaking in the case you xmalloc it.
No, because the p2 != p1 test prior ensures we only allocate non-empty strings.When you fix that leak, you'll stumble of the fact that in some cases you have this:
ts->error_desc = ""
while in others you have this:
ts->error_desc = (char *) xmalloc (p2 - p1 + 1);
How can you reliably know if you may xfreestrlen.
ts->error_desc that way? xfree ("") is a no go.
Comparing a pointer with "" is also not good.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |