fix coverity CID 322227

This commit is contained in:
iceman1001 2021-05-10 11:43:20 +02:00
parent 089ec732a7
commit 9498a07262

View file

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