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: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: "'Pedro Alves'" <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Fri, 14 Dec 2012 07:14:24 -0700
- 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>
>>>>> "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.
Tom