From a62199ac0fad058a37e95a74cc28e57a0acaf2e1 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 2 Jun 2020 09:15:56 +0200 Subject: [PATCH] fix: coverity 290109 resouce leak --- client/src/cmdscript.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/cmdscript.c b/client/src/cmdscript.c index 38c980765..4e9c5fc1f 100644 --- a/client/src/cmdscript.c +++ b/client/src/cmdscript.c @@ -169,6 +169,7 @@ static int CmdScriptRun(const char *Cmd) { char *extension_chk; extension_chk = str_dup(preferredName); str_lower(extension_chk); + pm3_scriptfile_t ext = PM3_UNSPECIFIED; if (str_endswith(extension_chk, ".lua")) { ext = PM3_LUA; @@ -180,6 +181,7 @@ static int CmdScriptRun(const char *Cmd) { ext = PM3_PY; } #endif + free(extension_chk); char *script_path = NULL; if (((ext == PM3_LUA) || (ext == PM3_UNSPECIFIED)) && (searchFile(&script_path, LUA_SCRIPTS_SUBDIR, preferredName, ".lua", true) == PM3_SUCCESS)) {