evas/font: free fg if fash memory allocation is failed 36/245536/1
authorYoungbok Shin <youngb.shin@samsung.com>
Mon, 12 Oct 2020 04:52:11 +0000 (13:52 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Mon, 12 Oct 2020 04:52:11 +0000 (13:52 +0900)
Change-Id: Iad3eec4225f333aad44ba1f6f2c606bb08006b46

src/lib/evas/common/evas_font_main.c

index bafb7fb..6539afb 100644 (file)
@@ -958,7 +958,15 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
    if (!fg_from_fash)
      {
         if (!fi->fash) fi->fash = _fash_gl_new();
-        if (fi->fash) _fash_gl_add(fi->fash, idx, fg);
+        if (fi->fash)
+          {
+             _fash_gl_add(fi->fash, idx, fg);
+          }
+        else
+          {
+             _glyph_free(fg);
+             return NULL;
+          }
      }
    /*******
     * END *