]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
table: Support unsetting NFTNL_TABLE_USERDATA attribute
authorPhil Sutter <phil@nwl.cc>
Wed, 10 Jul 2024 15:29:52 +0000 (17:29 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 10 Jul 2024 20:28:07 +0000 (22:28 +0200)
Cosmetics, but support unsetting anything that may be set.

Fixes: 99be0e6d066d7 ("table: add userdata support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/table.c

index 13f01cfbf1e6f82e077696342de99a5c2fb8963c..1a5f6f3bcc5079c1fcccc6f07b3122f1dcda7f7d 100644 (file)
@@ -74,6 +74,9 @@ void nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
        case NFTNL_TABLE_NAME:
                xfree(t->name);
                break;
+       case NFTNL_TABLE_USERDATA:
+               xfree(t->user.data);
+               break;
        case NFTNL_TABLE_FLAGS:
        case NFTNL_TABLE_HANDLE:
        case NFTNL_TABLE_FAMILY: