evas_common_font: prevent leaking RGBA_Font

prevent leaking RGBA_Font in the for loop,

CID: 1382852

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11709
This commit is contained in:
Ali Alzyod 2020-04-15 10:30:15 +00:00 committed by Stefan Schmidt
parent c6df676a70
commit 4ea455b1e5
1 changed files with 7 additions and 0 deletions

View File

@ -751,6 +751,13 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *
{
if (l == fonts || !font) /* First iteration OR no font */
{
/*This will suppress warnings for resource leak*/
if (font)
{
evas_common_font_free((RGBA_Font*)font);
font = NULL;
}
if (source) /* Load Font from "eet" source */
{
Eet_File *ef;