Skip to content

Commit d411a5e

Browse files
committed
fix: close the stream if execution fails
1 parent 4635344 commit d411a5e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/StreamTransport.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public function send($request)
6868
$responseHeaders = (array)$http_response_header;
6969
fclose($stream);
7070
} catch (\Exception $e) {
71+
if (is_resource($stream)) {
72+
fclose($stream);
73+
}
7174
Yii::endProfile($token, __METHOD__);
7275
throw new Exception($e->getMessage(), $e->getCode(), $e);
7376
}

0 commit comments

Comments
 (0)