summaryrefslogtreecommitdiffstats
path: root/iptables/nft-cache.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-06-02 12:56:06 +0200
committerPhil Sutter <phil@nwl.cc>2021-06-07 14:50:27 +0200
commit9b85e1ab3dbf0d9344562c5c76114496e3ebaa3a (patch)
tree297ae64c83a98f3b8c1e4ab0b739df1110cbe067 /iptables/nft-cache.c
parentca840c20b7b754d36a1abe7e597fd730dea142d4 (diff)
libxtables: Introduce xtables_strdup() and use it everywhere
This wraps strdup(), checking for errors. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft-cache.c')
-rw-r--r--iptables/nft-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/iptables/nft-cache.c b/iptables/nft-cache.c
index 8fbf9727..2c88301c 100644
--- a/iptables/nft-cache.c
+++ b/iptables/nft-cache.c
@@ -40,7 +40,7 @@ static void cache_chain_list_insert(struct list_head *list, const char *name)
}
new = xtables_malloc(sizeof(*new));
- new->name = strdup(name);
+ new->name = xtables_strdup(name);
list_add_tail(&new->head, pos ? &pos->head : list);
}
@@ -56,7 +56,7 @@ void nft_cache_level_set(struct nft_handle *h, int level,
return;
if (!req->table)
- req->table = strdup(cmd->table);
+ req->table = xtables_strdup(cmd->table);
else
assert(!strcmp(req->table, cmd->table));