mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-05 06:46:28 -04:00
modules: handle allocation errors
This commit is contained in:
parent
a55546c9df
commit
6f6b58785e
5 changed files with 29 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue