Skip to content

Commit

Permalink
Fix token memory allocation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUdude committed Sep 4, 2023
1 parent 1389463 commit e1fb8c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,10 @@ int main(int argc, char * argv [])
char *tok = strtok(portdup, ":");
int tokens;
for (tokens = 0; tokens < 4; tokens++) {
if (!tok)
break;
if (!tok) {
port_tok[tokens] = cfg_malloc(__func__, 1);
continue;
}
port_tok[tokens] = cfg_strdup(__func__, tok);
tok = strtok(NULL, ":");
}
Expand Down

0 comments on commit e1fb8c3

Please sign in to comment.