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 leaks in macro definitions.


On Tue, 2019-01-15 at 11:50 -0500, Simon Marchi wrote:
> > +  gdb::unique_xmalloc_ptr<char> name (extract_identifier (&exp, 0));
> > +  if (name.get () == NULL)
> 
> Nit, you don't have to use ".get ()" here.
One day, I will really have to learn some C++ :).

> 
> I think extract_identifier should return a gdb::unique_xmalloc_ptr.  
> This call site lower:
> 
>      argv[new_macro.argc] = extract_identifier (&exp, 1);
> 
> can then use ".release ()".
Yes, that looks like a cleaner approach.

I will update the patch once the question about how to
handle the splay tree leak is clarified
i.e. fix in GDB, or (incompatible) fix in libiberty.
(see other mail with Tom).

Thanks

Philippe


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