lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1296 - nss-pam-ldapd/nslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1296 - nss-pam-ldapd/nslcd



Author: arthur
Date: Thu Nov  4 21:35:54 2010
New Revision: 1296
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1296

Log:
fix race condition that could cause a memory leak

Modified:
   nss-pam-ldapd/nslcd/passwd.c

Modified: nss-pam-ldapd/nslcd/passwd.c
==============================================================================
--- nss-pam-ldapd/nslcd/passwd.c        Thu Nov  4 21:31:01 2010        (r1295)
+++ nss-pam-ldapd/nslcd/passwd.c        Thu Nov  4 21:35:54 2010        (r1296)
@@ -219,6 +219,9 @@
   uid=lookup_dn2uid(session,dn,NULL);
   /* store the result in the cache */
   pthread_mutex_lock(&dn2uid_cache_mutex);
+  /* try to get the entry from the cache here again because it could have
+     changed in the meantime */
+  cacheentry=dict_get(dn2uid_cache,dn);
   if (cacheentry==NULL)
   {
     /* allocate a new entry in the cache */
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits