Andrs Garca found out the share cleanup code crashes when you cleanup
and there are not lock/unlock functions set!
This commit is contained in:
parent
5a93f50394
commit
a9572bf88a
13
lib/share.c
13
lib/share.c
@ -158,11 +158,13 @@ curl_share_cleanup(CURLSH *sh)
|
||||
if (share == NULL)
|
||||
return CURLSHE_INVALID;
|
||||
|
||||
share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE,
|
||||
share->clientdata);
|
||||
if(share->lockfunc)
|
||||
share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE,
|
||||
share->clientdata);
|
||||
|
||||
if (share->dirty) {
|
||||
share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
|
||||
if(share->unlockfunc)
|
||||
share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
|
||||
return CURLSHE_IN_USE;
|
||||
}
|
||||
|
||||
@ -174,8 +176,9 @@ curl_share_cleanup(CURLSH *sh)
|
||||
Curl_cookie_cleanup(share->cookies);
|
||||
#endif /* CURL_DISABLE_HTTP */
|
||||
|
||||
share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
|
||||
free (share);
|
||||
if(share->unlockfunc)
|
||||
share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
|
||||
free(share);
|
||||
|
||||
return CURLSHE_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user