Skip to content

Commit 8a1f671

Browse files
committed
Fix resource leak in iptcembed() on error
Closes GH-18225.
1 parent 5e68671 commit 8a1f671

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Diff for: NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PHP NEWS
1616
. Fixed bug GH-18209 (Use-after-free in extract() with EXTR_REFS). (ilutov)
1717
. Fixed bug GH-18212 (fseek with SEEK_CUR whence value and negative offset
1818
leads to negative stream position). (David Carlier)
19+
. Fix resource leak in iptcembed() on error. (nielsdos)
1920

2021
10 Apr 2025, PHP 8.3.20
2122

Diff for: ext/standard/iptc.c

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ PHP_FUNCTION(iptcembed)
204204

205205
if (spool < 2) {
206206
if (zend_fstat(fileno(fp), &sb) != 0) {
207+
fclose(fp);
207208
RETURN_FALSE;
208209
}
209210

0 commit comments

Comments
 (0)