[commit] fix memory leak in maintenance_do_deprecate

Pedro Alves pedro@codesourcery.com
Sun Feb 27 17:13:00 GMT 2011


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



More information about the Gdb-patches mailing list