diff options
author | David Lamparter <equinox@diac24.net> | 2013-10-10 23:22:08 +0000 |
---|---|---|
committer | root <root@beaglebone.local.sublab.org> | 2013-10-10 23:22:08 +0000 |
commit | dbfd96c410369d6362d2eb3da52c4d58e959cfcc (patch) | |
tree | 8753edabde274d0eecb225c05e8b9ae6f19be8b1 | |
parent | 29f49063f7c496a55945d1e8dfe6cb6f97446487 (diff) |
fix reference/memory leaks
-rw-r--r-- | jsonrpc.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -245,11 +245,15 @@ char *jsonrpc_handler(void *apparg, const char *input, size_t input_len, struct } } } + json_decref(json_request); } else { json_response = jsonrpc_handle_request_single(apparg, json_request, method_table); + json_decref(json_request); } - if (json_response) + if (json_response) { output = json_dumps(json_response, JSON_INDENT(2)); + json_decref(json_response); + } return output; } |