Fix #808, When RAQM is used, and it fails or no text processed, the glyph may be leaked

master
Pierre Joye 2022-01-30 09:33:07 +07:00
parent 6cc1e39e9f
commit 767699b9f4
1 changed files with 6 additions and 0 deletions

View File

@ -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";
}
}