Skip to content

Commit

Permalink
dpvs: fix all cfgfile parser malloc problems
Browse files Browse the repository at this point in the history
  • Loading branch information
roykingz committed Sep 12, 2023
1 parent 33c9f43 commit d02d711
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ void *set_value(vector_t tokens)
str = VECTOR_SLOT(tokens, i);
len += strlen(str);
if (!alloc)
alloc = (char *) MALLOC(sizeof(char *) * (len + 1));
alloc = (char *) MALLOC(sizeof(char) * (len + 1));
else {
alloc = REALLOC(alloc, sizeof(char *) * (len + 1));
alloc = REALLOC(alloc, sizeof(char) * (len + 1));
tmp = VECTOR_SLOT(tokens, i - 1);
if ( *str != '"' && *tmp != '"')
strncat(alloc, " ", 1);
Expand Down

0 comments on commit d02d711

Please sign in to comment.