pulse-server: module-zeroconf-publish: handle allocation failure

This commit is contained in:
Barnabás Pőcze 2021-12-28 20:48:09 +01:00
parent 417b2e2bf7
commit 7fb27098b9

View file

@ -261,7 +261,8 @@ static struct service *create_service(struct module_zeroconf_publish_data *d, st
struct service *s; struct service *s;
s = pw_manager_object_add_data(o, SERVICE_DATA_ID, sizeof(*s)); s = pw_manager_object_add_data(o, SERVICE_DATA_ID, sizeof(*s));
spa_assert(s); if (s == NULL)
return NULL;
s->userdata = d; s->userdata = d;
s->entry_group = NULL; s->entry_group = NULL;
@ -550,6 +551,8 @@ static void manager_added(void *d, struct pw_manager_object *o)
return; return;
s = create_service(d, o); s = create_service(d, o);
if (s == NULL)
return;
publish_service(s); publish_service(s);
} }