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: [commit] fix memory leak in maintenance_do_deprecate


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


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