This reverts commit ff98d7ff5847e07a55b0c40c2ccc3bc430226ca0. 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 <vdole...@redhat.com> --- src/resize.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/resize.c b/src/resize.c index fc4ddb9..7ed1c93 100644 --- a/src/resize.c +++ b/src/resize.c @@ -928,6 +928,7 @@ int wi, he, hi; free((char *)p->w_hlines); p->w_hlines = nhlines; #endif + nmlines = nhlines = 0; /* change tabs */ if (p->w_width != wi) @@ -955,10 +956,6 @@ int wi, he, hi; } KillWindow(p); Msg(0, "%s", strnomem); - if (nmlines) - free(nmlines); - if (nhlines) - free(nhlines); return -1; } for (; t < wi; t++) -- 2.14.5