mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-13 05:33:51 -04:00
tokenize: reset *argv = NULL on error
This allows the caller to call free() without having to worry about whether it has already been free:d or not. Closes #49.
This commit is contained in:
parent
80741371c9
commit
22cd25d360
1 changed files with 1 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ tokenize_cmdline(char *cmdline, char ***argv)
|
||||||
if (delim != ' ') {
|
if (delim != ' ') {
|
||||||
LOG_ERR("unterminated %s quote\n", delim == '"' ? "double" : "single");
|
LOG_ERR("unterminated %s quote\n", delim == '"' ? "double" : "single");
|
||||||
free(*argv);
|
free(*argv);
|
||||||
|
*argv = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue