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] Fix leak of set/show verbose doc, avoid xfree of static string


>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> gdb/ChangeLog
Philippe> 2018-12-28  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

Philippe> 	* top.c (set_verbose): Free previous docs if doc_allocated.
Philippe> 	Internationalize messages.  Set doc_allocated to 0.

Thanks for the patch.  This is ok.

Philippe> +  if (c->doc && c->doc_allocated)
Philippe> +    xfree ((char *) c->doc);
Philippe> +  if (showcmd->doc && showcmd->doc_allocated)
Philippe> +    xfree ((char *) showcmd->doc);

Ideally I guess we'd have a better way of doing this.  A lot of the CLI
machinery could use some cleanup, but for now this is still an "open"
struct.

Tom


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