]> granicus.if.org Git - curl/commitdiff
When curl_easy_duphandle() fails because it can't get or make a connection
authorDaniel Stenberg <daniel@haxx.se>
Sat, 31 Mar 2007 11:28:03 +0000 (11:28 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 31 Mar 2007 11:28:03 +0000 (11:28 +0000)
cache, we must make sure not to derefence the NULL pointer...
CID 6 coverity.com scan

lib/easy.c

index dc18c7488153dd4694eb7be37073f4291896b776..cdd3570a23dcd33da58b7b7dfb3abbd35a9261f5 100644 (file)
@@ -627,7 +627,8 @@ CURL *curl_easy_duphandle(CURL *incurl)
 
   if(fail) {
     if(outcurl) {
-      if(outcurl->state.connc->type == CONNCACHE_PRIVATE)
+      if((outcurl->state.connc->type == CONNCACHE_PRIVATE) &&
+         outcurl->state.connc)
         Curl_rm_connc(outcurl->state.connc);
       if(outcurl->state.headerbuff)
         free(outcurl->state.headerbuff);