mirror of
https://git.savannah.gnu.org/git/screen.git
synced 2026-02-11 01:42:24 +02:00
Revert "those 0 assignment made rest of code totally not working"
This reverts commit ff98d7ff58.
This can potentially cause double-free. `nmlines' and `nhlines'
should be freed in preceding lines.
`nmlines' and `nhlines' are not used in the rest of the function
except in `nomem' label and their valuse are copied into `p', so
their value should be zeroed.
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
This commit is contained in:
committed by
Amadeusz Sławiński
parent
82f1ea1cba
commit
a47b9801fb
@@ -662,6 +662,7 @@ int ChangeWindowSize(Window *p, int wi, int he, int hi)
|
||||
if (p->w_hlines && p->w_hlines != nhlines)
|
||||
free((char *)p->w_hlines);
|
||||
p->w_hlines = nhlines;
|
||||
nmlines = nhlines = 0;
|
||||
|
||||
/* change tabs */
|
||||
if (p->w_width != wi) {
|
||||
@@ -682,10 +683,6 @@ int ChangeWindowSize(Window *p, int wi, int he, int hi)
|
||||
}
|
||||
KillWindow(p);
|
||||
Msg(0, "%s", strnomem);
|
||||
if (nmlines)
|
||||
free(nmlines);
|
||||
if (nhlines)
|
||||
free(nhlines);
|
||||
return -1;
|
||||
}
|
||||
for (; t < wi; t++)
|
||||
|
||||
Reference in New Issue
Block a user