From b674a8e78bf21985a05e17a3038f670bd8f46482 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 10 Jun 2016 14:47:53 +0200 Subject: src: check for strdup() errors from setters and parsers And pass up an error to the caller. Signed-off-by: Pablo Neira Ayuso --- src/table.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/table.c') diff --git a/src/table.c b/src/table.c index e4c61aa..3201d40 100644 --- a/src/table.c +++ b/src/table.c @@ -232,6 +232,8 @@ int nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t) if (tb[NFTA_TABLE_NAME]) { xfree(t->name); t->name = strdup(mnl_attr_get_str(tb[NFTA_TABLE_NAME])); + if (!t->name) + return -1; t->flags |= (1 << NFTNL_TABLE_NAME); } if (tb[NFTA_TABLE_FLAGS]) { -- cgit v1.2.3