diff mbox series

[libnftnl,1/2] chain: Support unsetting NFTNL_CHAIN_USERDATA attribute

Message ID 20240710153322.18574-1-phil@nwl.cc
State Accepted
Delegated to: Phil Sutter
Headers show
Series [libnftnl,1/2] chain: Support unsetting NFTNL_CHAIN_USERDATA attribute | expand

Commit Message

Phil Sutter July 10, 2024, 3:33 p.m. UTC
Cosmetics, but support unsetting anything that may be set.

Fixes: 76b82c425818e ("chain: add userdata and comment support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/chain.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Phil Sutter July 10, 2024, 9:09 p.m. UTC | #1
On Wed, Jul 10, 2024 at 05:33:21PM +0200, Phil Sutter wrote:
> Cosmetics, but support unsetting anything that may be set.
> 
> Fixes: 76b82c425818e ("chain: add userdata and comment support")
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Both patches applied.
diff mbox series

Patch

diff --git a/src/chain.c b/src/chain.c
index c7026f486b104..0b68939fe21a7 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -185,6 +185,9 @@  void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
 			xfree(c->dev_array[i]);
 		xfree(c->dev_array);
 		break;
+	case NFTNL_CHAIN_USERDATA:
+		xfree(c->user.data);
+		break;
 	default:
 		return;
 	}