From dbfd96c410369d6362d2eb3da52c4d58e959cfcc Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 10 Oct 2013 23:22:08 +0000 Subject: fix reference/memory leaks --- jsonrpc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jsonrpc.c b/jsonrpc.c index 4c54eb4..a02bbaa 100644 --- a/jsonrpc.c +++ b/jsonrpc.c @@ -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; } -- cgit v1.2.1