[RFA] Fix leak due to assigning a xstrdup-ed string to the std::string gdb_datadir

Philippe Waroquiers philippe.waroquiers@skynet.be
Mon Sep 30 19:54:00 GMT 2019


On Mon, 2019-09-30 at 08:01 -0600, Tom Tromey wrote:

> Philippe>    gdb_datadir
> Philippe> -    = xstrdup (relocate_gdb_directory (GDB_DATADIR,
> Philippe> -				     GDB_DATADIR_RELOCATABLE).c_str ());
> Philippe> +    = relocate_gdb_directory (GDB_DATADIR,
> Philippe> +			      GDB_DATADIR_RELOCATABLE).c_str ();
> 
> It seems to me that the c_str call can also be removed.
Effectively.  I have submitted RFAv2 with this additional change.

Thanks for the review

Philippe




More information about the Gdb-patches mailing list