devilhorns pushed a commit to branch master.

commit bb30cd58ce5e1e1ce171acf6ef51f530d31458ab
Author: Chris Michael <[email protected]>
Date:   Mon Jul 8 08:01:58 2013 +0100

    We cannot use dname in the error message if we have already freed it
    above, so fix. On a mkpath failure, print out the message, Then free
    dname. Be sure to also free dname if we do not error.
    
    NB: Fixes Coverity CID1039893
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ethumb/ethumb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c
index ad49444..eab57a2 100644
--- a/src/lib/ethumb/ethumb.c
+++ b/src/lib/ethumb/ethumb.c
@@ -1354,12 +1354,13 @@ ethumb_image_save(Ethumb *e)
 
    dname = ecore_file_dir_get(e->thumb_path);
    r = ecore_file_mkpath(dname);
-   free(dname);
    if (!r)
      {
         ERR("could not create directory '%s'", dname);
+        free(dname);
         return EINA_FALSE;
      }
+   free(dname);
 
    snprintf(flags, sizeof(flags), "quality=%d compress=%d",
             e->quality, e->compress);

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to