]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix reference counting in network interface information cache
authorAndreas Schwab <schwab@redhat.com>
Tue, 15 Nov 2011 09:32:18 +0000 (10:32 +0100)
committerAndreas Schwab <schwab@redhat.com>
Tue, 15 Nov 2011 09:58:00 +0000 (10:58 +0100)
ChangeLog
sysdeps/unix/sysv/linux/check_pf.c

index 139ba57532ccc0b1cfda2a447130377aa5ad20b5..8bb25138ca3a6341a7b298e57de4203e624c70db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-15  Andreas Schwab  <schwab@redhat.com>
+
+       * sysdeps/unix/sysv/linux/check_pf.c (make_request): Properly
+       count references to noai6ai_cached.
+
 2011-11-15  Ulrich Drepper  <drepper@gmail.com>
 
        * time/getdate.c (__getdate_r): Set FD_CLOEXEC for given file.
index 1f66684e4f9053570763dfa766d8915b2d85d2f1..895dc2a2852f3138881391c51a3b69f618e8e303 100644 (file)
@@ -58,7 +58,7 @@ struct cached_data
 
 static struct cached_data noai6ai_cached =
   {
-    .usecnt = 3,       /* Make sure we never try to delete this entry.  */
+    .usecnt = 1,       /* Make sure we never try to delete this entry.  */
     .in6ailen = 0
   };
 
@@ -273,6 +273,7 @@ make_request (int fd, pid_t pid)
     }
   else
     {
+      atomic_add(&noai6ai_cached.usecnt, 2);
       noai6ai_cached.seen_ipv4 = seen_ipv4;
       noai6ai_cached.seen_ipv6 = seen_ipv6;
       result = &noai6ai_cached;