summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jsonrpc.c6
1 files changed, 5 insertions, 1 deletions
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;
}