This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [patch] Fix [BZ#14122] memory leak in nss_parse_service_list


On 05/21/2012 07:13 AM, Paul Pluzhnikov wrote:
On Sun, May 20, 2012 at 4:22 PM, Paul Pluzhnikov<ppluzhnikov@google.com> wrote:

Here is a rather simple fix for [BZ#14122]: memory leak in
nss_parse_service_list.

That patch fixed leaks in the error paths, but did not fix the original problem.


Attached is an updated patch that fixes both.

Could you add a test case as well, please?


The rest looked fine but I'd like to see it reviewed together with the
testcase.

Thanks,
Andreas

Re-tested on Linux/x86_64 an i686.

Thanks,
--
Paul Pluzhnikov


2012-05-20 Paul Pluzhnikov<ppluzhnikov@google.com>


         [BZ #14122]
         * nss/nsswitch.c (defconfig_entries): New variable.
         (__nss_database_lookup): Don't leak defconfig entries.
         (nss_parse_service_list): Don't leak on error paths.
         (free_database_entries): New function.
         (free_defconfig): New function.
         (free_mem): Move common code to free_database_entries.


--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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