conncache.c: fix possible dereference of null pointer
authorMarc Hoersken <info@marc-hoersken.de>
Sat, 4 Jan 2014 15:34:58 +0000 (16:34 +0100)
committerMarc Hoersken <info@marc-hoersken.de>
Sat, 4 Jan 2014 15:34:58 +0000 (16:34 +0100)
lib/conncache.c

index 48271f7510ff545106ab8fb130526925fc584b60..391d44fe4c5af23a7ca7f4c48119a65321e09b41 100644 (file)
@@ -166,10 +166,13 @@ void Curl_conncache_remove_conn(struct conncache *connc,
     if(bundle->num_connections == 0) {
       conncache_remove_bundle(connc, bundle);
     }
-    connc->num_connections--;
 
-    DEBUGF(infof(conn->data, "The cache now contains %d members\n",
-                 connc->num_connections));
+    if(connc) {
+      connc->num_connections--;
+
+      DEBUGF(infof(conn->data, "The cache now contains %d members\n",
+                   connc->num_connections));
+    }
   }
 }