mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 09:08:49 -05:00
curl: cleanup multi handle on failure
... to fix memory leak in error path. Fixes #4772 Closes #4780 Reported-by: Brian Carpenter
This commit is contained in:
parent
291ed52122
commit
271ec6b9b6
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -2105,8 +2105,10 @@ static CURLcode parallel_transfers(struct GlobalConfig *global,
|
||||
|
||||
result = add_parallel_transfers(global, multi, share,
|
||||
&more_transfers, &added_transfers);
|
||||
if(result)
|
||||
if(result) {
|
||||
curl_multi_cleanup(multi);
|
||||
return result;
|
||||
}
|
||||
|
||||
while(!mcode && (still_running || more_transfers)) {
|
||||
mcode = curl_multi_poll(multi, NULL, 0, 1000, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user