mirror of
https://github.com/haiwen/libsearpc.git
synced 2025-10-21 04:08:39 +00:00
More memory leak fixed.
This commit is contained in:
@@ -349,14 +349,18 @@ char *searpc_named_pipe_send(void *arg, const gchar *fcall_str,
|
|||||||
uint32_t len = json_len;
|
uint32_t len = json_len;
|
||||||
if (pipe_write_n(client->pipe_fd, &len, sizeof(uint32_t)) < 0) {
|
if (pipe_write_n(client->pipe_fd, &len, sizeof(uint32_t)) < 0) {
|
||||||
g_warning("failed to send rpc call: %s", strerror(errno));
|
g_warning("failed to send rpc call: %s", strerror(errno));
|
||||||
|
free (json_str);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pipe_write_n(client->pipe_fd, json_str, json_len) < 0) {
|
if (pipe_write_n(client->pipe_fd, json_str, json_len) < 0) {
|
||||||
g_warning("failed to send rpc call: %s", strerror(errno));
|
g_warning("failed to send rpc call: %s", strerror(errno));
|
||||||
|
free (json_str);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free (json_str);
|
||||||
|
|
||||||
if (pipe_read_n(client->pipe_fd, &len, sizeof(uint32_t)) < 0) {
|
if (pipe_read_n(client->pipe_fd, &len, sizeof(uint32_t)) < 0) {
|
||||||
g_warning("failed to read rpc response: %s", strerror(errno));
|
g_warning("failed to read rpc response: %s", strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -228,6 +228,7 @@ test_searpc__simple_call (void)
|
|||||||
2, "string", "hello", "int", 10);
|
2, "string", "hello", "int", 10);
|
||||||
cl_assert (error->message);
|
cl_assert (error->message);
|
||||||
g_free (result);
|
g_free (result);
|
||||||
|
g_error_free(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -240,6 +241,7 @@ test_searpc__invalid_call (void)
|
|||||||
2, "string", "hello", "int", 2);
|
2, "string", "hello", "int", 2);
|
||||||
cl_assert (error != NULL);
|
cl_assert (error != NULL);
|
||||||
g_free (result);
|
g_free (result);
|
||||||
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
GObject *
|
GObject *
|
||||||
@@ -384,6 +386,7 @@ void simple_callback_error (void *result, void *user_data, GError *error)
|
|||||||
{
|
{
|
||||||
cl_assert (result == NULL);
|
cl_assert (result == NULL);
|
||||||
cl_assert (error != NULL);
|
cl_assert (error != NULL);
|
||||||
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user