From 893567bed69daa7e55b6b86bd9f57960128ca4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 21 May 2022 18:40:30 +0200 Subject: [PATCH] pulse-server: module-x11-bell: initialize `module` member Previously, `module_x11_bell_data::module` was not initialized properly, which led to a NULL pointer dereference in `module_schedule_unload()` when called from `module_destroy()` in case the native pipewire module was unloaded. See #2392 --- src/modules/module-protocol-pulse/modules/module-x11-bell.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/modules/module-x11-bell.c b/src/modules/module-protocol-pulse/modules/module-x11-bell.c index aef999d86..efbafc2ec 100644 --- a/src/modules/module-protocol-pulse/modules/module-x11-bell.c +++ b/src/modules/module-protocol-pulse/modules/module-x11-bell.c @@ -112,8 +112,9 @@ static const struct spa_dict_item module_x11_bell_info[] = { struct module *create_module_x11_bell(struct impl *impl, const char *argument) { - struct module *module; struct pw_properties *props = NULL; + struct module_x11_bell_data *data; + struct module *module; int res; PW_LOG_TOPIC_INIT(mod_topic); @@ -133,6 +134,9 @@ struct module *create_module_x11_bell(struct impl *impl, const char *argument) } module->props = props; + data = module->user_data; + data->module = module; + return module; out: pw_properties_free(props);