On Sat, Feb 06, 2021 at 03:20:20AM +0000, Anindya Mukherjee wrote: > Hi, there seems to be a memory leak in systat where the help text buffer > is not freed under some circumstances. As a result, repeatedly pressing, > for example, 'h' and 'space' keys will cause it to leak memory. Also > entering command mode with an active help text will leak the text. The > following diff fixes it.
Thanks for the diff, I committed it. I had to re-do it since your mailer used some MIME encoding, the result is visible here: https://marc.info/?l=openbsd-bugs&m=161258168001057&q=mbox While using bugs@ is perfectly fine, I would probably rather send such a fix to tech@. > > Index: engine.c > =================================================================== > RCS file: /cvs/src/usr.bin/systat/engine.c,v > retrieving revision 1.26 > diff -u -p -r1.26 engine.c > --- engine.c 9 Jan 2021 12:49:09 -0000 1.26 > +++ engine.c 6 Feb 2021 03:07:37 -0000 > @@ -1139,7 +1139,7 @@ command_set(struct command *cmd, const c > cmdbuf[0] = 0; > } > } > - curr_message = NULL; > + message_set(NULL); > curr_cmd = cmd; > need_update = 1; > return prev; > @@ -1235,7 +1235,7 @@ keyboard(void) > > if (curr_message != NULL) { > if (ch > 0) { > - curr_message = NULL; > + message_set(NULL); > need_update = 1; > } > } > > ok? > > Regards, > Anindya >
