mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-23 08:56:47 -05:00
core: handle NULL props and cleanups
This commit is contained in:
parent
611ce2151e
commit
1e71b24952
1 changed files with 6 additions and 7 deletions
|
|
@ -152,18 +152,17 @@ core_create_node(void *object,
|
||||||
struct pw_client *client = resource->client;
|
struct pw_client *client = resource->client;
|
||||||
struct pw_node_factory *factory;
|
struct pw_node_factory *factory;
|
||||||
struct pw_properties *properties;
|
struct pw_properties *properties;
|
||||||
int i;
|
|
||||||
|
|
||||||
factory = pw_core_find_node_factory(client->core, factory_name);
|
factory = pw_core_find_node_factory(client->core, factory_name);
|
||||||
if (factory == NULL)
|
if (factory == NULL)
|
||||||
goto no_factory;
|
goto no_factory;
|
||||||
|
|
||||||
properties = pw_properties_new(NULL, NULL);
|
if (props) {
|
||||||
if (properties == NULL)
|
properties = pw_properties_new_dict(props);
|
||||||
goto no_mem;
|
if (properties == NULL)
|
||||||
|
goto no_mem;
|
||||||
for (i = 0; i < props->n_items; i++)
|
} else
|
||||||
pw_properties_set(properties, props->items[i].key, props->items[i].value);
|
properties = NULL;
|
||||||
|
|
||||||
/* error will be posted */
|
/* error will be posted */
|
||||||
pw_node_factory_create_node(factory, client, name, properties, new_id);
|
pw_node_factory_create_node(factory, client, name, properties, new_id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue