From 46b887ca6b0382d135599a83ed0884aeaf97a357 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 10 Jun 2016 15:07:13 +0200 Subject: src: simplify unsetters If the attribute is set as we already check at the beginning of this function, then we can release the object. Signed-off-by: Pablo Neira Ayuso --- src/table.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/table.c') diff --git a/src/table.c b/src/table.c index 3201d40..412c6aa 100644 --- a/src/table.c +++ b/src/table.c @@ -64,10 +64,7 @@ void nftnl_table_unset(struct nftnl_table *t, uint16_t attr) switch (attr) { case NFTNL_TABLE_NAME: - if (t->name) { - xfree(t->name); - t->name = NULL; - } + xfree(t->name); break; case NFTNL_TABLE_FLAGS: case NFTNL_TABLE_FAMILY: -- cgit v1.2.3