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: [RFA] Avoid memory leaks in set_language function.


>>>>> "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


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