1
0
mirror of https://github.com/haiwen/libsearpc.git synced 2025-09-13 13:32:45 +00:00

Fix memory leak

This commit is contained in:
poetwang
2014-08-14 23:48:58 +08:00
parent 0d9e1b662d
commit 8998e7b2c5

View File

@@ -263,12 +263,13 @@ searpc_server_call_function (const char *svc_name,
}
array = json_loadb (func, len, 0 ,&jerror);
setjetoge(&jerror,&error);
if (!array) {
char buf[512];
setjetoge(&jerror,&error);
snprintf (buf, 511, "failed to load RPC call: %s\n", error->message);
json_decref (array);
g_error_free(error);
return error_to_json (511, buf, ret_len);
}