diff options
author | Liping Zhang <liping.zhang@spreadtrum.com> | 2016-08-28 16:36:22 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-30 12:43:30 +0200 |
commit | d815b8d2bf18bc589f10c3fb4524a2b93fe91b93 (patch) | |
tree | ed9cb427339727707621ba566122479471f74ba8 /src | |
parent | 595f08823d46dc44f91092d660ead1495346f18b (diff) |
meta: fix memory leak in tc classid parser
We forgot to free the str which was allocated by xstrdup,
so memory leak will happen.
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/meta.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -90,7 +90,7 @@ static struct error_record *tchandle_type_parse(const struct expr *sym, struct expr **res) { uint32_t handle; - char *str; + char *str = NULL; if (strcmp(sym->identifier, "root") == 0) handle = TC_H_ROOT; @@ -127,6 +127,7 @@ static struct error_record *tchandle_type_parse(const struct expr *sym, handle = strtoull(sym->identifier, NULL, 0); } out: + xfree(str); *res = constant_expr_alloc(&sym->location, sym->dtype, BYTEORDER_HOST_ENDIAN, sizeof(handle) * BITS_PER_BYTE, &handle); |