diff options
author | shadchin <[email protected]> | 2022-04-08 17:59:41 +0300 |
---|---|---|
committer | shadchin <[email protected]> | 2022-04-08 17:59:41 +0300 |
commit | 3ddbfb08ff9f73d895488293e6a83b4ba68b3c5a (patch) | |
tree | e9250668656f42d41807809160f7919ef3630ee9 /contrib/libs/curl/lib/share.c | |
parent | 61f0d7ab77dad7c33fb4d2570d36e4e76f672bbf (diff) |
CONTRIB-2513 Update contrib/libs/curl to 7.75.0
ref:7c8de2c266b810de3b31604360c6ad878fa166ab
Diffstat (limited to 'contrib/libs/curl/lib/share.c')
-rw-r--r-- | contrib/libs/curl/lib/share.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/libs/curl/lib/share.c b/contrib/libs/curl/lib/share.c index 5ce9830335a..4f1804dbd2b 100644 --- a/contrib/libs/curl/lib/share.c +++ b/contrib/libs/curl/lib/share.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -37,6 +37,7 @@ curl_share_init(void) { struct Curl_share *share = calloc(1, sizeof(struct Curl_share)); if(share) { + share->magic = CURL_GOOD_SHARE; share->specifier |= (1<<CURL_LOCK_DATA_SHARE); if(Curl_mk_dnscache(&share->hostcache)) { @@ -59,6 +60,9 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) void *ptr; CURLSHcode res = CURLSHE_OK; + if(!GOOD_SHARE_HANDLE(share)) + return CURLSHE_INVALID; + if(share->dirty) /* don't allow setting options while one or more handles are already using this share */ @@ -184,7 +188,7 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) CURLSHcode curl_share_cleanup(struct Curl_share *share) { - if(share == NULL) + if(!GOOD_SHARE_HANDLE(share)) return CURLSHE_INVALID; if(share->lockfunc) @@ -218,6 +222,7 @@ curl_share_cleanup(struct Curl_share *share) if(share->unlockfunc) share->unlockfunc(NULL, CURL_LOCK_DATA_SHARE, share->clientdata); + share->magic = 0; free(share); return CURLSHE_OK; |