From 8fc4abedf12b8f1f2db2e860180194750f36a296 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sat, 4 Jan 2014 16:34:58 +0100 Subject: conncache.c: fix possible dereference of null pointer --- lib/conncache.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/conncache.c') 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)); + } } } -- cgit v1.2.3