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 <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 13:13:15 +01:00
parent 61e17aa5c2
commit 7fc497ee6e
1 changed files with 4 additions and 5 deletions

View File

@ -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);