mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-28 21:37:33 -04:00
protocol-simple: close client_fd when client alloc fails
This commit is contained in:
parent
b9761926df
commit
593b5cf148
1 changed files with 5 additions and 3 deletions
|
|
@ -588,14 +588,13 @@ on_connect(void *data, int fd, uint32_t mask)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (server->n_clients >= MAX_CLIENTS) {
|
if (server->n_clients >= MAX_CLIENTS) {
|
||||||
close(client_fd);
|
|
||||||
errno = ECONNREFUSED;
|
errno = ECONNREFUSED;
|
||||||
goto error;
|
goto error_close;
|
||||||
}
|
}
|
||||||
|
|
||||||
client = calloc(1, sizeof(struct client));
|
client = calloc(1, sizeof(struct client));
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
goto error;
|
goto error_close;
|
||||||
|
|
||||||
client->impl = impl;
|
client->impl = impl;
|
||||||
client->server = server;
|
client->server = server;
|
||||||
|
|
@ -654,6 +653,9 @@ on_connect(void *data, int fd, uint32_t mask)
|
||||||
create_streams(impl, client);
|
create_streams(impl, client);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
error_close:
|
||||||
|
close(client_fd);
|
||||||
error:
|
error:
|
||||||
pw_log_error("%p: failed to create client: %m", impl);
|
pw_log_error("%p: failed to create client: %m", impl);
|
||||||
pw_properties_free(props);
|
pw_properties_free(props);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue