mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
modules: check for a NULL resource in client-device and client-node
See https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/113
This commit is contained in:
parent
31a84a8deb
commit
d4d6458b5b
2 changed files with 14 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue