mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
modules-sap: fix uninitialized variable when close in error
This commit is contained in:
parent
242d75c6fc
commit
50be29ad18
1 changed files with 3 additions and 2 deletions
|
|
@ -1488,7 +1488,7 @@ on_sap_io(void *data, int fd, uint32_t mask)
|
|||
|
||||
static int start_sap(struct impl *impl)
|
||||
{
|
||||
int fd, res;
|
||||
int fd = -1, res;
|
||||
struct timespec value, interval;
|
||||
char addr[128] = "invalid";
|
||||
|
||||
|
|
@ -1528,7 +1528,8 @@ static int start_sap(struct impl *impl)
|
|||
|
||||
return 0;
|
||||
error:
|
||||
close(fd);
|
||||
if (fd > 0)
|
||||
close(fd);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue