From be2cdf14f3e5043c2909898975913a1316d00850 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 26 Feb 2004 11:39:38 +0000 Subject: Don't call the lock/unlock functions if they are NULL. They can still be NULL without violating protocol. --- lib/share.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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<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<unlockfunc (data, type, share->clientdata); + if(share->unlockfunc) /* only call this if set! */ + share->unlockfunc (data, type, share->clientdata); } return CURLSHE_OK; -- cgit v1.2.3