support: make sure loop_add_io is closes the fd when asked

When the close argument is true, loop_add_io is supposed to close the fd
even when an error occurs.

This makes it possible to have spa_steal_fd() work even in the case
of errors.
This commit is contained in:
Wim Taymans 2026-05-15 13:20:31 +02:00
parent 398f74571b
commit a9f62579ba

View file

@ -922,6 +922,8 @@ error_exit_free:
free(source);
errno = -res;
error_exit:
if (close)
spa_system_close(impl->system, fd);
return NULL;
}