This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] Fix other memory leak in solib_target_current_sos
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Tom Tromey'" <tromey at redhat dot com>
- Cc: "'Pedro Alves'" <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Sat, 15 Dec 2012 00:28:20 +0100
- Subject: RE: [RFA] Fix other memory leak in solib_target_current_sos
- References: <50c9b7e6.25f2440a.3810.3771SMTPIN_ADDED_BROKEN@mx.google.com> <50CA3784.2030706@redhat.com> <000301cdd9d0$0db345d0$2919d170$@muller@ics-cnrs.unistra.fr> <50CAF521.3040307@redhat.com> <43198.6185875305$1355480794@news.gmane.org> <87hano3em7.fsf@fleche.redhat.com>
> -----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