From 7fc497ee6e762f94ea0174340ef7154d4245fc38 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 8 Jul 2013 13:13:15 +0100 Subject: [PATCH] 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 --- 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 ef23d327b5..734fbfe711 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);