summaryrefslogtreecommitdiff
path: root/lib/conncache.c
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2014-01-04 16:34:58 +0100
committerMarc Hoersken <info@marc-hoersken.de>2014-01-04 16:34:58 +0100
commit8fc4abedf12b8f1f2db2e860180194750f36a296 (patch)
tree7d312fc5eb58dbb0a44a01e769c4d8bf1f2aadf5 /lib/conncache.c
parentc216179af4c6d9bd69e7f83aa3975ab1a6ed44df (diff)
downloadcurl-8fc4abedf12b8f1f2db2e860180194750f36a296.tar.gz
conncache.c: fix possible dereference of null pointer
Diffstat (limited to 'lib/conncache.c')
-rw-r--r--lib/conncache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/conncache.c b/lib/conncache.c
index 48271f751..391d44fe4 100644
--- a/lib/conncache.c
+++ b/lib/conncache.c
@@ -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));
+ }
}
}