diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-06-10 15:07:13 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-06-15 13:26:32 +0200 |
commit | 46b887ca6b0382d135599a83ed0884aeaf97a357 (patch) | |
tree | 7e252be40ff5ba4b7978bc19228714cfef33df4d /src/table.c | |
parent | 5b8ae79fae3bc8be9663bd752c7ec466a95ac180 (diff) |
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 <pablo@netfilter.org>
Diffstat (limited to 'src/table.c')
-rw-r--r-- | src/table.c | 5 |
1 files changed, 1 insertions, 4 deletions
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: |