From 67e8da3390980df4fd8e31a020fd033293dfd0f2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 5 May 2026 14:44:18 +0200 Subject: [PATCH] modules: handle some allocation failures --- src/modules/zeroconf-utils/zeroconf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/zeroconf-utils/zeroconf.c b/src/modules/zeroconf-utils/zeroconf.c index a3ec5f4a8..f11728307 100644 --- a/src/modules/zeroconf-utils/zeroconf.c +++ b/src/modules/zeroconf-utils/zeroconf.c @@ -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++) {