summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2022-01-30 09:33:07 +0700
committerPierre Joye <pierre.php@gmail.com>2022-01-30 09:33:07 +0700
commit767699b9f4911ee5cd488c035cb4c1033ef5cf40 (patch)
tree1f47810b46c8e7dd0a4cd69557f617110ca7a710
parent6cc1e39e9fddd15ae74adb1a09fcd5740f44923e (diff)
downloadlibgd-767699b9f4911ee5cd488c035cb4c1033ef5cf40.tar.gz
Fix #808, When RAQM is used, and it fails or no text processed, the glyph may be leaked
-rw-r--r--src/gdft.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gdft.c b/src/gdft.c
index 745110f..1a38bcd 100644
--- a/src/gdft.c
+++ b/src/gdft.c
@@ -1509,6 +1509,9 @@ BGD_DECLARE(char *) gdImageStringFTEx (gdImagePtr im, int *brect, int fg, const
gdFree(text);
gdCacheDelete (tc_cache);
gdMutexUnlock (gdFontCacheMutex);
+ if (info) {
+ gdFree(info);
+ }
return "Problem loading glyph";
}
@@ -1524,6 +1527,9 @@ BGD_DECLARE(char *) gdImageStringFTEx (gdImagePtr im, int *brect, int fg, const
gdFree(text);
gdCacheDelete (tc_cache);
gdMutexUnlock (gdFontCacheMutex);
+ if (info) {
+ gdFree(info);
+ }
return "Problem rendering glyph";
}
}