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: OndÅej BÃlka <neleai at seznam dot cz>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 24 Sep 2013 21:37:10 +0200
- Subject: Re: [PATCH] Properly cache the result from looking up the nss database config
- Authentication-results: sourceware.org; auth=none
- References: <mvmbocest0s dot fsf at hawking dot suse dot de>
On Thu, Jan 24, 2013 at 12:46:27PM +0100, 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).
>
> Andreas.
>
As discussed in
http://sourceware.org/ml/libc-alpha/2013-09/msg00735.html
there is another patch that fixes same bug.
As this fixes logic in more places than alternative I would go with this
patch.