[830] in Zephyr_Bugs
memory leak in tty_filter.c in zwgc from zephyr 2.0.4
daemon@ATHENA.MIT.EDU (Greg Stark)
Mon Oct 28 21:20:55 1996
Date: Mon, 28 Oct 96 21:20 EST
From: Greg Stark <gsstark@MIT.EDU>
To: bug-zephyr@MIT.EDU
The following patch fixes a fairly severe memory leak in zwgc ttymode.
It leaks about 16*2*(number of @constructs) bytes per zephyr.
That can really add up, i was averaging about 400bytes/zephyr.
greg
*** tty_filter.c.~1~ Fri Jul 7 18:00:28 1995
--- tty_filter.c Mon Oct 28 21:17:38 1996
***************
*** 435,445 ****
desctype *desc;
int number_of_strs;
int number_of_lines;
! tty_str_info *info;
int max_line_width;
desc = disp_get_cmds(text_copy, &number_of_strs, &number_of_lines);
! info = convert_desc_to_tty_str_info(desc);
free_desc(desc);
#ifdef DEBUG
--- 435,445 ----
desctype *desc;
int number_of_strs;
int number_of_lines;
! tty_str_info *info, *info_head;
int max_line_width;
desc = disp_get_cmds(text_copy, &number_of_strs, &number_of_lines);
! info_head = info = convert_desc_to_tty_str_info(desc);
free_desc(desc);
#ifdef DEBUG
***************
*** 538,544 ****
}
}
! free_info(info);
free(text_copy);
if (number_of_lines &&
(result_so_far[string_Length(result_so_far)-1] != '\n'))
--- 538,544 ----
}
}
! free_info(info_head);
free(text_copy);
if (number_of_lines &&
(result_so_far[string_Length(result_so_far)-1] != '\n'))