This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Avoid memory leaks in set_language function.
- From: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 05 Dec 2012 11:18:51 -0700
- Subject: Re: [RFA] Avoid memory leaks in set_language function.
- References: <1043.9041689553$1354727529@news.gmane.org>
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> This also revealed a few memory leaks
Pierre> related to repeated add_language function calls.
Wow, add_language is gross. I had no idea.
Pierre> + if (iter->doc && iter->flags & DOC_ALLOCATED)
I think parens around the second clause here.
Actually I tend to prefer the wordier
(iter->flags & DOC_ALLOCATED) != 0
Pierre> #define MALLOCED_REPLACEMENT 0x4
Pierre> -
Pierre> +#define DOC_ALLOCATED 0x8
Pierre> struct cmd_list_element
Please preserve the blank line after the block of #defines.
Ok with those changes.
Tom