This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH/commit] Handle errors in tracepoint target agent
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Stan Shebs <stan at codesourcery dot com>
- Date: Fri, 26 Mar 2010 11:40:09 +0000
- Subject: Re: [PATCH/commit] Handle errors in tracepoint target agent
- References: <4BAC1426.5050003@codesourcery.com>
On Friday 26 March 2010 01:55:50, Stan Shebs wrote:
> 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.
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 xfree
ts->error_desc that way? xfree ("") is a no go.
Comparing a pointer with "" is also not good.
--
Pedro Alves