This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] fix memory leak in maintenance_do_deprecate
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Michael Snyder <msnyder at vmware dot com>
- Date: Sun, 27 Feb 2011 17:10:21 +0000
- Subject: Re: [commit] fix memory leak in maintenance_do_deprecate
- References: <4D69A236.6070102@vmware.com>
On Sunday 27 February 2011 01:00:38, Michael Snyder wrote:
> + /* If we get here, don't leak! */
> + if (replacement != NULL)
FYI, checks against NULL are not necessary, as xfree/free
is always safe with a NULL argument. IMO, the comment
adds more distraction that value, so I'd not have added
it (if you see an xfree, it's obvious you're guarding
against a leak).
> + xfree (replacement);
--
Pedro Alves