Commit 3163ac7
ext/curl: fix mem leak when duphandle fails in curl_clone_obj (#22899)
Move init_curl_handle() so that memory is not leaked if
curl_easy_duphandle() fails within curl_clone_obj().
init_curl_handle() allocates state that curl_free_obj() later frees, but
curl_free_obj() does nothing if ch->cp is not set. In curl_clone_obj(), defer
that allocation until a valid copied handle exists so failed duplication leaves
nothing to clean up.
Closes #228991 parent ad70bbd commit 3163ac7
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
445 | 444 | | |
446 | 445 | | |
447 | 446 | | |
| |||
450 | 449 | | |
451 | 450 | | |
452 | 451 | | |
| 452 | + | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| |||
0 commit comments