diff options
author | Phil Sutter <phil@nwl.cc> | 2018-10-12 17:50:15 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-15 13:37:51 +0200 |
commit | 27d8946db90b79762a36e66647bb8d8fc4c17ce9 (patch) | |
tree | f7361692655df925dbb841dec8c9ef8f73c01187 | |
parent | c7a5401943df8b6b96f6b5eedd9a1e0013e01d86 (diff) |
json: Fix memleak in dup_stmt_json()
The variable 'root' is always assigned to after initialization, so there
is no point in initializing it upon declaration.
Fixes: e70354f53e9f6 ("libnftables: Implement JSON output support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/json.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1131,7 +1131,7 @@ json_t *notrack_stmt_json(const struct stmt *stmt, struct output_ctx *octx) json_t *dup_stmt_json(const struct stmt *stmt, struct output_ctx *octx) { - json_t *root = json_object(); + json_t *root; if (stmt->dup.to) { root = json_pack("{s:o}", "addr", expr_print_json(stmt->dup.to, octx)); |