aboutsummaryrefslogtreecommitdiff
path: root/lib/share.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-02-26 11:39:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-02-26 11:39:38 +0000
commitbe2cdf14f3e5043c2909898975913a1316d00850 (patch)
treefea34603fca123d1480b79246928d10feb940e37 /lib/share.c
parent0943f33438925976c7b3e09d5f6e4e53bd7c46ce (diff)
Don't call the lock/unlock functions if they are NULL. They can still be
NULL without violating protocol.
Diffstat (limited to 'lib/share.c')
-rw-r--r--lib/share.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/share.c b/lib/share.c
index d6cb7cfdc..ff1aef2e5 100644
--- a/lib/share.c
+++ b/lib/share.c
@@ -186,7 +186,8 @@ Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
return CURLSHE_INVALID;
if(share->specifier & (1<<type)) {
- share->lockfunc(data, type, accesstype, share->clientdata);
+ if(share->lockfunc) /* only call this if set! */
+ share->lockfunc(data, type, accesstype, share->clientdata);
}
/* else if we don't share this, pretend successful lock */
@@ -202,7 +203,8 @@ Curl_share_unlock(struct SessionHandle *data, curl_lock_data type)
return CURLSHE_INVALID;
if(share->specifier & (1<<type)) {
- share->unlockfunc (data, type, share->clientdata);
+ if(share->unlockfunc) /* only call this if set! */
+ share->unlockfunc (data, type, share->clientdata);
}
return CURLSHE_OK;