modules: handle allocation errors

This commit is contained in:
Wim Taymans 2026-05-01 12:29:54 +02:00
parent a55546c9df
commit 6f6b58785e
5 changed files with 29 additions and 1 deletions

View file

@ -664,12 +664,20 @@ static int create_fifo(struct impl *impl)
impl->info.channels, impl->info.rate);
impl->filename = strdup(filename);
if (impl->filename == NULL) {
res = -errno;
goto error;
}
impl->unlink_fifo = do_unlink_fifo;
impl->fd = fd;
return 0;
error:
if (impl->timer)
pw_loop_destroy_source(impl->data_loop, impl->timer);
if (impl->socket)
pw_loop_destroy_source(impl->data_loop, impl->socket);
if (do_unlink_fifo)
unlink(filename);
if (fd >= 0)