mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pulse-server: module-zeroconf-publish: avoid double-free
When a module's `load()` fails, its `unload()` will unconditionally be called. Freeing resource in `load()` while not marking those resources freed (e.g. setting the pointers to NULL) will result in double-free when the module's `unload()` method is called.
This commit is contained in:
parent
9a9fce66e0
commit
9769dee5e7
1 changed files with 0 additions and 3 deletions
|
|
@ -573,15 +573,12 @@ static int module_zeroconf_publish_load(struct client *client, struct module *mo
|
|||
client_callback, data, &error);
|
||||
if (!data->client) {
|
||||
pw_log_error("avahi_client_new() failed: %s", avahi_strerror(error));
|
||||
pw_avahi_poll_free(data->avahi_poll);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
data->manager = pw_manager_new(data->core);
|
||||
if (client->manager == NULL) {
|
||||
pw_log_error("Failed to create pipewire manager");
|
||||
avahi_client_free(data->client);
|
||||
pw_avahi_poll_free(data->avahi_poll);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue