Blame SOURCES/0024-json-Fix-memleak-in-dup_stmt_json.patch

9ff721
From 5b386b65d61c0f2831ef31a3674225dc21f9e1ff Mon Sep 17 00:00:00 2001
9ff721
From: Phil Sutter <phil@nwl.cc>
9ff721
Date: Fri, 12 Oct 2018 17:50:15 +0200
9ff721
Subject: [PATCH] json: Fix memleak in dup_stmt_json()
9ff721
9ff721
The variable 'root' is always assigned to after initialization, so there
9ff721
is no point in initializing it upon declaration.
9ff721
9ff721
Fixes: e70354f53e9f6 ("libnftables: Implement JSON output support")
9ff721
Signed-off-by: Phil Sutter <phil@nwl.cc>
9ff721
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
9ff721
(cherry picked from commit 27d8946db90b79762a36e66647bb8d8fc4c17ce9)
9ff721
Signed-off-by: Phil Sutter <psutter@redhat.com>
9ff721
---
9ff721
 src/json.c | 2 +-
9ff721
 1 file changed, 1 insertion(+), 1 deletion(-)
9ff721
9ff721
diff --git a/src/json.c b/src/json.c
9ff721
index eeba90e266f75..66b02a934a24b 100644
9ff721
--- a/src/json.c
9ff721
+++ b/src/json.c
9ff721
@@ -1030,7 +1030,7 @@ json_t *notrack_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
9ff721
 
9ff721
 json_t *dup_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
9ff721
 {
9ff721
-	json_t *root = json_object();
9ff721
+	json_t *root;
9ff721
 
9ff721
 	if (stmt->dup.to) {
9ff721
 		root = json_pack("{s:o}", "addr", expr_print_json(stmt->dup.to, octx));
9ff721
-- 
bacbc8
2.21.0
9ff721