Skip to content

Commit be8e9cd

Browse files
committed
Fixed memory leak in HTML5::saveHTML()
1 parent d7961a8 commit be8e9cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/HTML5.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ public function saveHTML($dom, $options = array())
234234
$stream = fopen('php://temp', 'wb');
235235
$this->save($dom, $stream, array_merge($this->defaultOptions, $options));
236236

237-
return stream_get_contents($stream, -1, 0);
237+
$html = stream_get_contents($stream, -1, 0);
238+
239+
fclose($stream);
240+
241+
return $html;
238242
}
239243
}

0 commit comments

Comments
 (0)