1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

removed NULL-checks after malloc: they are not necessary, they were not consequently used and objects constructed by 3rd party libs are also unchecked

This commit is contained in:
Falk Werner
2020-03-21 21:22:22 +01:00
parent 220df4ad50
commit 214d6b738d
22 changed files with 101 additions and 168 deletions

View File

@@ -8,13 +8,10 @@ struct wf_jsonrpc_method * wf_jsonrpc_impl_method_create(
void * user_data)
{
struct wf_jsonrpc_method * method = malloc(sizeof(struct wf_jsonrpc_method));
if (NULL != method)
{
method->next = NULL;
method->name = strdup(method_name);
method->invoke = invoke;
method->user_data = user_data;
}
method->next = NULL;
method->name = strdup(method_name);
method->invoke = invoke;
method->user_data = user_data;
return method;
}

View File

@@ -16,10 +16,7 @@ wf_jsonrpc_impl_proxy_create(
void * user_data)
{
struct wf_jsonrpc_proxy * proxy = malloc(sizeof(struct wf_jsonrpc_proxy));
if (NULL != proxy)
{
wf_jsonrpc_impl_proxy_init(proxy, manager, timeout, send, user_data);
}
wf_jsonrpc_impl_proxy_init(proxy, manager, timeout, send, user_data);
return proxy;
}

View File

@@ -29,12 +29,9 @@ wf_jsonrpc_impl_request_create(
void * user_data)
{
struct wf_jsonrpc_request * request = malloc(sizeof(struct wf_jsonrpc_request));
if (NULL != request)
{
request->id = id;
request->send = send;
request->user_data = user_data;
}
request->id = id;
request->send = send;
request->user_data = user_data;
return request;
}

View File

@@ -24,10 +24,7 @@ struct wf_jsonrpc_server *
wf_jsonrpc_impl_server_create(void)
{
struct wf_jsonrpc_server * server = malloc(sizeof(struct wf_jsonrpc_server));
if (NULL != server)
{
wf_jsonrpc_impl_server_init(server);
}
wf_jsonrpc_impl_server_init(server);
return server;
}