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 other memory leak in solib_target_current_sos


> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé?: vendredi 14 décembre 2012 15:14
> À?: Pierre Muller
> Cc?: 'Pedro Alves'; gdb-patches@sourceware.org
> Objet?: Re: [RFA] Fix other memory leak in solib_target_current_sos
> 
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
writes:
> 
> Pierre>    library_list = solib_target_parse_libraries (library_document);
> Pierre>    if (library_list == NULL)
> Pierre> -    return NULL;
> Pierre> +    {
> Pierre> +      xfree (library_document);
> Pierre> +      return NULL;
> Pierre> +    }
> 
> It seems to me that you could unconditionally free it here, before the if.

  That's what the committed version does
thanks to Pedro's suggestion....

Pierre


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