diff options
author | David Lamparter <equinox@diac24.net> | 2013-10-10 23:20:40 +0000 |
---|---|---|
committer | root <root@beaglebone.local.sublab.org> | 2013-10-10 23:20:40 +0000 |
commit | f12be4da8d9520be572c142ae276f3b96f292fee (patch) | |
tree | 6917fc20de5c9a0f35f9130603985ca2e4a96f36 /cethcan/rpc.c | |
parent | ecfa61ab231482d6403add3f163250564824fc62 (diff) |
cethcan: fix memory management
- primary config structure no longer left allocated in main()
- memleak in RPC result buffer handling
Diffstat (limited to 'cethcan/rpc.c')
-rw-r--r-- | cethcan/rpc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cethcan/rpc.c b/cethcan/rpc.c index fa11ecc..bfe6026 100644 --- a/cethcan/rpc.c +++ b/cethcan/rpc.c @@ -109,8 +109,10 @@ void rpc_perform(struct evbuffer *request, /* TODO: asynchronous calls */ char *output = jsonrpc_handler(NULL, data, len, method_table); - if (output) + if (output) { evbuffer_add(outbuf, output, strlen(output)); + free(output); + } response_handler(handler_arg, outbuf); evbuffer_free(outbuf); } |