From 8a1f6711bf75da789fbc23a63629d16a1925e252 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 1 Apr 2025 22:54:17 +0200 Subject: [PATCH] Fix resource leak in iptcembed() on error Closes GH-18225. --- NEWS | 1 + ext/standard/iptc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 188c5a87796..92b199270cf 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ PHP NEWS . Fixed bug GH-18209 (Use-after-free in extract() with EXTR_REFS). (ilutov) . Fixed bug GH-18212 (fseek with SEEK_CUR whence value and negative offset leads to negative stream position). (David Carlier) + . Fix resource leak in iptcembed() on error. (nielsdos) 10 Apr 2025, PHP 8.3.20 diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index e4dd3863757..44dd33bab10 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -204,6 +204,7 @@ PHP_FUNCTION(iptcembed) if (spool < 2) { if (zend_fstat(fileno(fp), &sb) != 0) { + fclose(fp); RETURN_FALSE; }