curses memory: 'anything identifier'

Three or four instances of one simple memory leak.  Allocating a union
'anything' to pass to add_menu(), then not doing anything with it.  The
value gets copied so there's no reason for the original to stick around.

[There are still lots of other memory leaks.]
This commit is contained in:
PatR
2019-02-07 17:10:55 -08:00
parent 19d737951e
commit 1d5b59ab7e
3 changed files with 10 additions and 16 deletions
+3 -5
View File
@@ -473,7 +473,7 @@ curses_get_window_orientation(winid wid)
void
curses_puts(winid wid, int attr, const char *text)
{
anything *identifier;
anything Id;
WINDOW *win = NULL;
if (is_main_window(wid)) {
@@ -502,10 +502,8 @@ curses_puts(winid wid, int attr, const char *text)
wid);
return;
}
identifier = (anything *) alloc((unsigned) sizeof (anything));
identifier->a_void = NULL;
curses_add_nhmenu_item(wid, NO_GLYPH, identifier, 0, 0, attr, text,
FALSE);
Id = zeroany;
curses_add_nhmenu_item(wid, NO_GLYPH, &Id, 0, 0, attr, text, FALSE);
} else {
waddstr(win, text);
wnoutrefresh(win);