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:
Daniel Eklöf 2020-07-27 06:03:30 +02:00
parent 80741371c9
commit 22cd25d360
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -46,6 +46,7 @@ tokenize_cmdline(char *cmdline, char ***argv)
if (delim != ' ') {
LOG_ERR("unterminated %s quote\n", delim == '"' ? "double" : "single");
free(*argv);
*argv = NULL;
return false;
}