Skip to content

Commit 7656b73

Browse files
authored
Merge pull request #1 from jeijei4/patch-1
When the execution fails, the cURL resource is not closed
2 parents 6d0644d + c223beb commit 7656b73

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Client.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ public function run(Request $request) : Response
6565
$info = (array) \curl_getinfo($handle);
6666
}
6767
if ($body === false) {
68+
$error = \curl_error($handle);
69+
$errno = \curl_errno($handle);
70+
@\curl_close($handle);
6871
throw new RequestException(
69-
\curl_error($handle),
70-
\curl_errno($handle),
72+
$error,
73+
$errno,
7174
info: $info
7275
);
7376
}

0 commit comments

Comments
 (0)