diff --git a/src/Transport/Curl.php b/src/Transport/Curl.php index bcbe64f..fa66bee 100644 --- a/src/Transport/Curl.php +++ b/src/Transport/Curl.php @@ -31,8 +31,6 @@ class Curl implements TransportInterface { if ($this->throwErrors) { if ( false === $exec) { $errno = curl_errno($ch); - curl_close($ch); - throw new CurlException(implode(PHP_EOL, array_filter([ curl_error($ch) , static::CURL_ERROR[$errno] ?? null ])), $errno); } elseif ($code >= 400) { @@ -40,8 +38,6 @@ class Curl implements TransportInterface { } } - curl_close($ch); - return $exec; } @@ -59,12 +55,8 @@ class Curl implements TransportInterface { if ( ( false === $execute ) && $this->throwErrors ) { $errno = curl_errno($ch); - curl_close($ch); throw new CurlException(implode(PHP_EOL, array_filter([ curl_error($ch) , static::CURL_ERROR[$errno] ?? null ])), $errno); } - else { - curl_close($ch); - } return $execute ? (object) $execute : null; }