Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2015 20:45:40 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r278530 - head/lib/libc/nls
Message-ID:  <201502102045.t1AKjemC011229@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Tue Feb 10 20:45:40 2015
New Revision: 278530
URL: https://svnweb.freebsd.org/changeset/base/278530

Log:
  When catopen(3) returns an error, it caches the result of that error
  from r202992. The refcount on the cache entry is not initialized, so
  any attempt to clean the cache will skip over this item since it likely
  has a >0 value.
  
  This change is currently a NOP. There is work in progress to support
  freeing the cache which requires this change to avoid a memory leak.
  
  MFC after:	2 weeks
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/lib/libc/nls/msgcat.c

Modified: head/lib/libc/nls/msgcat.c
==============================================================================
--- head/lib/libc/nls/msgcat.c	Tue Feb 10 19:41:30 2015	(r278529)
+++ head/lib/libc/nls/msgcat.c	Tue Feb 10 20:45:40 2015	(r278530)
@@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
 				  	np->name = strdup(n);			\
 					np->path = NULL;			\
 					np->catd = NLERR;			\
+					np->refcount = 0;			\
 					np->lang = (l == NULL) ? NULL :		\
 					    strdup(l);				\
 					np->caterrno = e;			\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502102045.t1AKjemC011229>