stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4ea455b1e52963bcb7c1c284e0358fbf8120fe25

commit 4ea455b1e52963bcb7c1c284e0358fbf8120fe25
Author: Ali <[email protected]>
Date:   Wed Apr 15 10:30:15 2020 +0000

    evas_common_font: prevent leaking RGBA_Font
    
    prevent leaking RGBA_Font in the for loop,
    
    CID: 1382852
    
    Reviewed-by: Stefan Schmidt <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11709
---
 src/lib/evas/canvas/evas_font_dir.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lib/evas/canvas/evas_font_dir.c 
b/src/lib/evas/canvas/evas_font_dir.c
index 5b945dcb27..533993f94a 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -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;

-- 


Reply via email to