This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Properly cache the result from looking up the nss database config
- From: Andreas Jaeger <aj at suse dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 17 May 2013 09:46:09 +0200
- Subject: Re: [PATCH] Properly cache the result from looking up the nss database config
- References: <mvm1uaizij8 dot fsf at hawking dot suse dot de>
On 04/10/2013 02:17 PM, Andreas Schwab wrote:
The last argument of __nss_database_lookup is supposed to be used as a
cache for the lookup result, but three callers do not properly make use
of it: they store it in a local variable instead of in the static one
that is defined for that purpose. __nss_database_lookup is expecting to
be called only once for each database; if there is no config for a
database it reparses the default each time which allocates new memory
(though technically it's not a leak since it frees all of it at program
exit).
Ok, thanks,
Andreas
--
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