Commit d4d6458b authored by Peter Hutterer's avatar Peter Hutterer
Browse files

modules: check for a NULL resource in client-device and client-node

See pipewire/wireplumber#113
parent 31a84a8d
Pipeline #449418 passed with stages
in 5 minutes and 3 seconds
......@@ -75,9 +75,15 @@ static void *create_object(void *_data,
struct pw_impl_factory *this = data->this;
void *result;
struct pw_resource *device_resource;
struct pw_impl_client *client = pw_resource_get_client(resource);
struct pw_impl_client *client;
int res;
if (resource == NULL) {
res = -EINVAL;
goto error_exit;
}
client = pw_resource_get_client(resource);
device_resource = pw_resource_new(client, new_id, PW_PERM_ALL, type, version, 0);
if (device_resource == NULL) {
res = -errno;
......
......@@ -77,9 +77,15 @@ static void *create_object(void *_data,
{
void *result;
struct pw_resource *node_resource;
struct pw_impl_client *client = pw_resource_get_client(resource);
struct pw_impl_client *client;
int res;
if (resource == NULL) {
res = -EINVAL;
goto error_exit;
}
client = pw_resource_get_client(resource);
node_resource = pw_resource_new(client, new_id, PW_PERM_ALL, type, version, 0);
if (node_resource == NULL) {
res = -errno;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment