Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/engines/common


Modified Files:
        evas_font_load.c 


Log Message:


some extra checks and leak fix

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- evas_font_load.c    23 May 2005 06:29:40 -0000      1.20
+++ evas_font_load.c    26 Aug 2005 08:00:49 -0000      1.21
@@ -305,7 +305,11 @@
    if (!fi) return NULL;
 //   printf("LOAD FONT MEM  %s %i\n", name, size);
    fn = calloc(1, sizeof(RGBA_Font));
-   if (!fn) return NULL;
+   if (!fn)
+      {
+         free(fi);
+         return NULL;
+      }
    fn->fonts = evas_list_append(fn->fonts, fi);
    return fn;
 }
@@ -320,7 +324,11 @@
    if (!fi) return NULL;
 //   printf("LOAD FONT FILE  %s %i\n", name, size);
    fn = calloc(1, sizeof(RGBA_Font));
-   if (!fn) return NULL;
+   if (!fn)
+      {
+         free(fi);
+         return NULL;
+      }
    fn->fonts = evas_list_append(fn->fonts, fi);
    return fn;
 }
@@ -330,6 +338,8 @@
 {
    RGBA_Font_Int *fi;
 
+   if (!fn)
+      return NULL;
    fi = evas_common_font_int_load(name, size);
    if (fi)
      {
@@ -344,6 +354,8 @@
 {
    RGBA_Font_Int *fi;
 
+   if (!fn)
+      return NULL;
    fi = evas_common_font_int_memory_load(name, size, data, data_size);
    if (fi)
      {
@@ -358,6 +370,8 @@
 {
    Evas_List *l;
 
+   if (!fn)
+      return;
    for (l = fn->fonts; l; l = l->next)
      {
        RGBA_Font_Int *fi;




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to