1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00

sshd: fix leak on disconnect

Disconnect wants to keep a copy of the description string, but it is never
freed.  Make it ephemeral just for the ->disconnect_reason() op so it is
cleaned out correctly.
This commit is contained in:
Andy Green 2021-11-07 06:58:57 +00:00
parent 095798d5d9
commit 270a14813f

View file

@ -1349,7 +1349,6 @@ again:
case SSHS_NVC_DISCONNECT_DESC:
pss->disconnect_desc = (char *)pss->last_alloc;
pss->last_alloc = NULL; /* it was adopted */
state_get_string(pss, SSHS_NVC_DISCONNECT_LANG);
break;