Skip to content

Commit

Permalink
protocol: fix potential pty buf leak on process exit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Aug 18, 2022
1 parent 520ce17 commit efefd56
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down

0 comments on commit efefd56

Please sign in to comment.