mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07: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 **
|
// new memory size is default 20 for char **
|
||||||
int size = 20;
|
int size = 20;
|
||||||
cmd->cmd = (char **) malloc(size * sizeof(char **));
|
cmd->cmd = (char **) malloc(size * sizeof(char **));
|
||||||
if (!cmd->cmd) return NULL;
|
if (!cmd->cmd) {
|
||||||
|
free(cmd);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
// parse
|
// parse
|
||||||
char *pStr = strtok(pTmp, " ");
|
char *pStr = strtok(pTmp, " ");
|
||||||
cmd->cmd[0] = pStr;
|
cmd->cmd[0] = pStr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue