aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Zhijian <lizhijian@cn.fujitsu.com>2015-12-23 15:43:19 +0800
committerMichael Roth <mdroth@linux.vnet.ibm.com>2016-03-17 16:34:15 -0500
commitabda95cb016ad6fc85481e86b1f80c908c09d594 (patch)
tree68a65d74b304e66b21532426b80c68195fc9c85c
parent6a49a71cc652431538ba7ed00379fbaab1e7343c (diff)
net/dump: fix nfds->filename leak
Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> (cherry picked from commit b50c7d452f5aef52cc9e7461f215cab87c3f3b03) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--net/dump.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/dump.c b/net/dump.c
index ce16a4b0e3..347b5ca334 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -329,6 +329,13 @@ static void filter_dump_instance_init(Object *obj)
file_dump_set_filename, NULL);
}
+static void filter_dump_instance_finalize(Object *obj)
+{
+ NetFilterDumpState *nfds = FILTER_DUMP(obj);
+
+ g_free(nfds->filename);
+}
+
static void filter_dump_class_init(ObjectClass *oc, void *data)
{
NetFilterClass *nfc = NETFILTER_CLASS(oc);
@@ -343,6 +350,7 @@ static const TypeInfo filter_dump_info = {
.parent = TYPE_NETFILTER,
.class_init = filter_dump_class_init,
.instance_init = filter_dump_instance_init,
+ .instance_finalize = filter_dump_instance_finalize,
.instance_size = sizeof(NetFilterDumpState),
};