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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user