mirror of
https://github.com/haiwen/libsearpc.git
synced 2025-09-05 06:40:18 +00:00
Fix a pointer bug.
This commit is contained in:
@@ -500,7 +500,7 @@ handle_ret_common (char *data, size_t len, json_t **object, GError **error)
|
|||||||
|
|
||||||
*object=json_loadb(data,len,0,&jerror);
|
*object=json_loadb(data,len,0,&jerror);
|
||||||
if (*object == NULL) {
|
if (*object == NULL) {
|
||||||
setjetoge(&jerror,*error);
|
setjetoge(&jerror,error);
|
||||||
json_decref (*object);
|
json_decref (*object);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -263,7 +263,7 @@ 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);
|
setjetoge(&jerror,&error);
|
||||||
|
|
||||||
if (!array) {
|
if (!array) {
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
@@ -13,10 +13,10 @@ typedef enum {
|
|||||||
json_t *json_gobject_serialize (GObject *);
|
json_t *json_gobject_serialize (GObject *);
|
||||||
GObject *json_gobject_deserialize (GType , json_t *);
|
GObject *json_gobject_deserialize (GType , json_t *);
|
||||||
|
|
||||||
inline static void setjetoge(const json_error_t *jerror, GError *error)
|
inline static void setjetoge(const json_error_t *jerror, GError **error)
|
||||||
{
|
{
|
||||||
/* Load is the only function I use which reports errors */
|
/* Load is the only function I use which reports errors */
|
||||||
g_set_error(&error, SEARPC_JSON_DOMAIN, SEARPC_JSON_ERROR_LOAD, "%s", jerror->text);
|
g_set_error(error, SEARPC_JSON_DOMAIN, SEARPC_JSON_ERROR_LOAD, "%s", jerror->text);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static const char *json_object_get_string_or_null_member (json_t *object,const char *member_name)
|
inline static const char *json_object_get_string_or_null_member (json_t *object,const char *member_name)
|
||||||
|
Reference in New Issue
Block a user