From 9498a072629fa600b4c13ebd08832d4777452a1b Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 10 May 2021 11:43:20 +0200 Subject: [PATCH] fix coverity CID 322227 --- client/src/fileutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/fileutils.c b/client/src/fileutils.c index 65f193647..028db71e0 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -676,16 +676,16 @@ int saveFileJSONroot(const char *preferredName, void *root, size_t flags, bool v int res = json_dump_file(root, filename, flags); - free(filename); - if ( res == 0 ) { if (verbose) { PrintAndLogEx(SUCCESS, "saved to json file " _YELLOW_("%s"), filename); } + free(filename); return PM3_SUCCESS; } else { PrintAndLogEx(FAILED, "error: can't save the file: " _YELLOW_("%s"), filename); } + free(filename); return PM3_EFILE; }