diff options
author | Álvaro Neira Ayuso <alvaroneay@gmail.com> | 2013-08-14 12:19:19 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-17 12:49:54 +0200 |
commit | 0334a23918ebb008f81694e855141b8d8f5f72a9 (patch) | |
tree | a49a29e51fe88de8eb3253b4539f9082f7da4f89 /src/internal.h | |
parent | 7c24c00fe03318a4b95a0b9cf02257604c954937 (diff) |
json: fixed some leaks in the json parsing function
This patch fixes some leaks in the json parsing function. After this patch,
we use nft_jansson_free_root. This function uses json_decref and it
decrements the reference count and it releases the node if needed.
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/internal.h')
-rw-r--r-- | src/internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/internal.h b/src/internal.h index 62eb3c5..5ca2288 100644 --- a/src/internal.h +++ b/src/internal.h @@ -48,7 +48,9 @@ int nft_jansson_value_parse_val(json_t *root, const char *tag, int type, void *out); const char *nft_jansson_value_parse_str(json_t *root, const char *tag); bool nft_jansson_node_exist(json_t *root, const char *tag); -json_t *nft_jansson_get_root(char *json, const char *tag, json_error_t *err); +json_t *nft_jansson_create_root(char *json, json_error_t *err); +json_t *nft_jansson_get_node(json_t *root, const char *tag); +void nft_jansson_free_root(json_t *root); int nft_jansson_parse_family(json_t *root, void *out); #endif |