When curl_easy_duphandle() fails because it can't get or make a connection

cache, we must make sure not to derefence the NULL pointer...
CID 6 coverity.com scan
This commit is contained in:
Daniel Stenberg 2007-03-31 11:28:03 +00:00
parent e535a71c71
commit 371a25eee9
1 changed files with 2 additions and 1 deletions

View 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);