netfilter_set_position and netfilter_set_netdev_id overwrote their
respective fields with g_strdup without freeing the previous value,
leaking memory on each property write.
Fixes: fdccce459621 ("init/cleanup of netfilter object")
Signed-off-by: Marc-André Lureau <[email protected]>
---
net/filter.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/filter.c b/net/filter.c
index c7cc6615dc9..389f3b0bfef 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -130,6 +130,7 @@ static void netfilter_set_netdev_id(Object *obj, const char
*str, Error **errp)
{
NetFilterState *nf = NETFILTER(obj);
+ g_free(nf->netdev_id);
nf->netdev_id = g_strdup(str);
}
@@ -182,6 +183,7 @@ static void netfilter_set_position(Object *obj, const char
*str, Error **errp)
{
NetFilterState *nf = NETFILTER(obj);
+ g_free(nf->position);
nf->position = g_strdup(str);
}
--
2.54.0