mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-25 05:04:19 +01:00
protocol: fix potential pty buf leak on process exit
This commit is contained in:
@@ -363,9 +363,8 @@ int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user,
|
||||
|
||||
server->client_count--;
|
||||
lwsl_notice("WS closed from %s, clients: %d\n", pss->address, server->client_count);
|
||||
if (pss->buffer != NULL) {
|
||||
free(pss->buffer);
|
||||
}
|
||||
if (pss->buffer != NULL) free(pss->buffer);
|
||||
if (pss->pty_buf != NULL) pty_buf_free(pss->pty_buf);
|
||||
for (int i = 0; i < pss->argc; i++) {
|
||||
free(pss->args[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user