mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-06 17:18:02 +02:00
modules: handle some allocation failures
This commit is contained in:
parent
3db8038652
commit
67e8da3390
1 changed files with 8 additions and 0 deletions
|
|
@ -530,6 +530,10 @@ static struct entry *entry_new(struct pw_zeroconf *zc, uint32_t type, const void
|
|||
e->type = type;
|
||||
e->user = user;
|
||||
e->props = pw_properties_new_dict(info);
|
||||
if (e->props == NULL) {
|
||||
free(e);
|
||||
return NULL;
|
||||
}
|
||||
spa_list_append(&zc->entries, &e->link);
|
||||
spa_list_init(&e->services);
|
||||
|
||||
|
|
@ -588,6 +592,10 @@ struct pw_zeroconf * pw_zeroconf_new(struct pw_context *context,
|
|||
spa_hook_list_init(&zc->listener_list);
|
||||
spa_list_init(&zc->entries);
|
||||
zc->props = props ? pw_properties_new_dict(props) : pw_properties_new(NULL, NULL);
|
||||
if (zc->props == NULL) {
|
||||
free(zc);
|
||||
return NULL;
|
||||
}
|
||||
zc->discover_local = true;
|
||||
|
||||
for (i = 0; props && i < props->n_items; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue