mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-31 04:39:49 +08:00
cppcheck mem leak
This commit is contained in:
parent
6a006677ef
commit
16f5107915
1 changed files with 4 additions and 1 deletions
|
@ -50,7 +50,10 @@ CMD *parse_command_line(const char *commandStr) {
|
|||
// new memory size is default 20 for char **
|
||||
int size = 20;
|
||||
cmd->cmd = (char **) malloc(size * sizeof(char **));
|
||||
if (!cmd->cmd) return NULL;
|
||||
if (!cmd->cmd) {
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
// parse
|
||||
char *pStr = strtok(pTmp, " ");
|
||||
cmd->cmd[0] = pStr;
|
||||
|
|
Loading…
Reference in a new issue