Skip to content

Commit 033dd8a

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
2 parents ed9c1b8 + 1015de3 commit 033dd8a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

ext/gd/libgd/gdkanji.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ do_convert (unsigned char *to, unsigned char *from, const char *code)
368368
else
369369
error ("something happen");
370370
strcpy ((char *) to, (const char *) from);
371+
if (iconv_close (cd) != 0)
372+
error ("iconv_close() error");
371373
return;
372374
}
373375

ext/gd/tests/gh19955.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
GH-19955: (imagefttext() memory leak)
3+
--EXTENSIONS--
4+
gd
5+
--CREDITS--
6+
YuanchengJiang
7+
--FILE--
8+
<?php
9+
ini_set('error_reporting', E_ALL&~E_WARNING);
10+
$im = imagecreate(64, 32);
11+
imagefttext(imagecreate(8, 8), 0, 0, 0, 0, 255, __DIR__ . "/Tuffy.ttf", 'Ж');
12+
echo "OK"
13+
?>
14+
--EXPECT--
15+
OK

0 commit comments

Comments
 (0)