aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-03-31 10:56:07 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-03-31 10:56:07 +0000
commitb9e5fecf5f381f5a54edc73882f5fabaac1ac40d (patch)
treed8f6f72d2aecdd85c23550cf24fe66fd359f968a /lib
parent3af08472ad792c598c3257ffc8e9198c8b66f34d (diff)
Check for a NULL easy->easy_conn in multi_getsock() since it can in fact
happen when curl_multi_remove_handle() is called. CID 13. coverity.com scan
Diffstat (limited to 'lib')
-rw-r--r--lib/multi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 2a4f1a16c..ec9fd3309 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -680,7 +680,14 @@ static int multi_getsock(struct Curl_one_easy *easy,
of sockets */
int numsocks)
{
- if (easy->easy_handle->state.pipe_broke) {
+ /* If the pipe broke, or if there's no connection left for this easy handle,
+ then we MUST bail out now with no bitmask set. The no connection case can
+ happen when this is called from curl_multi_remove_handle() =>
+ singlesocket() => multi_getsock().
+ */
+
+ if (easy->easy_handle->state.pipe_broke ||
+ !easy->easy_conn) {
return 0;
}