devilhorns pushed a commit to branch master.
commit 7fc497ee6e762f94ea0174340ef7154d4245fc38
Author: Chris Michael <[email protected]>
Date: Mon Jul 8 13:13:15 2013 +0100
Fix memleak reported by Coverity:
If we have file And fname, then we can call the source_fetch_file
function, HOWEVER we may only have One or the Other in which case we
still need to potentially free the other.
NB: Fixes Coverity CID1039296
Signed-off-by: Chris Michael <[email protected]>
---
src/bin/edje/edje_cc_sources.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/bin/edje/edje_cc_sources.c b/src/bin/edje/edje_cc_sources.c
index ef23d32..734fbfe 100644
--- a/src/bin/edje/edje_cc_sources.c
+++ b/src/bin/edje/edje_cc_sources.c
@@ -192,11 +192,10 @@ source_fetch_file(const char *fil, const char *filname)
got_hash = 0;
}
if ((file) && (fname))
- {
- source_fetch_file(file, fname);
- free(file);
- free(fname);
- }
+ source_fetch_file(file, fname);
+
+ if (file) free(file);
+ if (fname) free(fname);
}
free(dir);
fclose(f);
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev