diff options
author | Rosen Penev <rosenp@gmail.com> | 2016-12-17 17:12:28 -0800 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2016-12-19 08:53:10 +0100 |
commit | db070f15ac559e3bd406cb8b8cccf40f78e75094 (patch) | |
tree | ef8247c449c24e0309337b15cb82ce87509e00b5 /validate | |
parent | acc48b553adfbdba77a5fa19e11bf7d69c65d596 (diff) | |
download | ubox-db070f15ac559e3bd406cb8b8cccf40f78e75094.tar.gz |
ubox: Fix some memory leaks
Avoids leaking memory when exiting early.
Signed-off by: Rosen <rosenp@gmail.com>
Diffstat (limited to 'validate')
-rw-r--r-- | validate/validate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/validate/validate.c b/validate/validate.c index 5bc3bc4..0628407 100644 --- a/validate/validate.c +++ b/validate/validate.c @@ -173,8 +173,10 @@ dt_type_list(struct dt_state *s, int nargs) char *p, *str = strdup(s->value); const char *value = s->value; - if (!str || !nargs) + if (!str || !nargs) { + free(str); return false; + } for (p = strtok(str, " \t"); p; p = strtok(NULL, " \t")) { |