summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrĂ©goire Pineau <[email protected]>2020-06-30 18:00:52 +0200
committerGrĂ©goire Pineau <[email protected]>2020-06-30 18:00:52 +0200
commitbe8e9cdf2d33d5ed829c6b3c9f45ce078d40b788 (patch)
tree66395cd092d51b4ce8a38321ea0476a025005ede /src
parentd7961a84793032d9e09f865a64fa49c6b38cde70 (diff)
Fixed memory leak in HTML5::saveHTML()
Diffstat (limited to 'src')
-rw-r--r--src/HTML5.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/HTML5.php b/src/HTML5.php
index 6316e43..94faa1e 100644
--- a/src/HTML5.php
+++ b/src/HTML5.php
@@ -234,6 +234,10 @@ class HTML5
$stream = fopen('php://temp', 'wb');
$this->save($dom, $stream, array_merge($this->defaultOptions, $options));
- return stream_get_contents($stream, -1, 0);
+ $html = stream_get_contents($stream, -1, 0);
+
+ fclose($stream);
+
+ return $html;
}
}