ref: abc13e8a85ea689dace99e77bc07ba2e96f5cebc
parent: 28ab39287fc46940577a8279e912116698a18b98
author: Jacob Moody <moody@posixcafe.org>
date: Sun Apr 21 14:40:08 EDT 2024
rio: fix memory leak with closed kbdtap (thanks aap)
--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -352,7 +352,7 @@
{
Window *cur = nil;
Channel *c;
- char *s;
+ char *s, *t;
enum { Akbd, Aopen, Aclose, Awrite, NALT };
Alt alts[NALT+1] = {
@@ -397,6 +397,8 @@
}
if(c == totap)
totap = nil;
+ while(nbrecv(c, &t))
+ free(t);
chanfree(c);
break;
case Awrite:
--
⑨