module-protocol-native: close fds from zombie clients

When a client is zombie, close the fds we got in the discarded message
or else we leak them.

See #1840
This commit is contained in:
Wim Taymans 2023-06-05 13:28:04 +02:00
parent 22acf94f7d
commit 8db98b114d
2 changed files with 16 additions and 5 deletions

View file

@ -919,12 +919,18 @@ process_remote(struct client *impl)
proxy = pw_core_find_proxy(this, msg->id);
if (proxy == NULL || proxy->zombie) {
uint32_t i;
if (proxy == NULL)
pw_log_error("%p: could not find proxy %u", this, msg->id);
else
pw_log_debug("%p: zombie proxy %u", this, msg->id);
/* FIXME close fds */
/* close fds */
for (i = 0; i < msg->n_fds; i++) {
pw_log_debug("%p: close fd:%d", conn, msg->fds[i]);
close(msg->fds[i]);
}
continue;
}