diff options
author | Phil Sutter <phil@nwl.cc> | 2019-07-18 17:16:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-07-18 20:01:17 +0200 |
commit | 9f8abc60c260b89a4350848e2e971ce60e642a12 (patch) | |
tree | fd91acd376aa7713a97ec4f56bfec6bcbde711ba /src | |
parent | 87b20c663e963853fa304acb2e9c30d39ca1426e (diff) |
json: Fix memleak in timeout_policy_json()
Use the correct function when populating policy property value,
otherwise the temporary objects' refcounts are incremented.
Fixes: c82a26ebf7e9f ("json: Add ct timeout support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/json.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -266,8 +266,8 @@ static json_t *timeout_policy_json(uint8_t l4, const uint32_t *timeout) if (!root) root = json_object(); - json_object_set(root, timeout_protocol[l4].state_to_name[i], - json_integer(timeout[i])); + json_object_set_new(root, timeout_protocol[l4].state_to_name[i], + json_integer(timeout[i])); } return root ? : json_null(); } |