projects
/
ttyd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
520ce17
)
protocol: fix potential pty buf leak on process exit
author
Shuanglei Tao
<tsl0922@gmail.com>
Thu, 18 Aug 2022 04:14:46 +0000
(12:14 +0800)
committer
Shuanglei Tao
<tsl0922@gmail.com>
Thu, 18 Aug 2022 04:14:46 +0000
(12:14 +0800)
src/protocol.c
patch
|
blob
|
history
diff --git
a/src/protocol.c
b/src/protocol.c
index 731b54fa5ed803a19f016f53260cd07149788523..5341c3d38f6d391d4c486754d353a4d3878df4a2 100644
(file)
--- a/
src/protocol.c
+++ b/
src/protocol.c
@@
-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]);
}