summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-10-10 23:22:08 +0000
committerroot <root@beaglebone.local.sublab.org>2013-10-10 23:22:08 +0000
commitdbfd96c410369d6362d2eb3da52c4d58e959cfcc (patch)
tree8753edabde274d0eecb225c05e8b9ae6f19be8b1
parent29f49063f7c496a55945d1e8dfe6cb6f97446487 (diff)
fix reference/memory leaks
-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;
}