devilhorns pushed a commit to branch master.

commit ff9b4775e8be65ee94a20ec6a13d5d2dcf7de86b
Author: Chris Michael <[email protected]>
Date:   Mon Aug 5 15:32:12 2013 +0100

    Fix memleak in data_thread_script of edje_cc_out
    
    NB: If we are going to exit data_thread_script function due to malloc
    failure or fread failure, then we should close the previously fdopen'd
    file so that we do not leak 'f'.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/bin/edje/edje_cc_out.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index c5caf2f..889d9a0 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -1185,6 +1185,7 @@ data_thread_script(void *data, Ecore_Thread *thread 
EINA_UNUSED)
                            sc->tmpo);
                   sc->errstr = strdup(buf);
                   free(dat);
+                  fclose(f);
                   return;
                }
             snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i",
@@ -1197,6 +1198,7 @@ data_thread_script(void *data, Ecore_Thread *thread 
EINA_UNUSED)
              snprintf(buf, sizeof(buf),
                       "Alloc failed for %lu bytes", (unsigned long)size);
              sc->errstr = strdup(buf);
+             fclose(f);
              return;
           }
      }

-- 

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk

Reply via email to