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