1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

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:
Daniel Stenberg 2004-07-02 08:28:31 +00:00
parent 5a93f50394
commit a9572bf88a

View File

@ -158,10 +158,12 @@ curl_share_cleanup(CURLSH *sh)
if (share == NULL)
return CURLSHE_INVALID;
if(share->lockfunc)
share->lockfunc(NULL, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE,
share->clientdata);
if (share->dirty) {
if(share->unlockfunc)
share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
return CURLSHE_IN_USE;
}
@ -174,6 +176,7 @@ curl_share_cleanup(CURLSH *sh)
Curl_cookie_cleanup(share->cookies);
#endif /* CURL_DISABLE_HTTP */
if(share->unlockfunc)
share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata);
free(share);