screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [screen-devel] Memory Leak in FreeAltScreen


From: Daniel De Graaf
Subject: Re: [screen-devel] Memory Leak in FreeAltScreen
Date: Mon, 1 May 2006 18:34:29 -0500

The free() is still needed; FreeMline() just frees the structures
referenced by p->w_alt_hlines, not p->w_alt_hlines itself. Run under
valgrind with and without the free()s, and switch to the altscreen a
few times to see.

- Daniel De Graaf

On 5/1/06, Eric Wald <address@hidden> wrote:
Daniel De Graaf wrote:
>    if (p->w_alt_mlines)
>      for (i = 0; i < p->w_alt_height; i++)
>        FreeMline(p->w_alt_mlines + i);
> +  free(p->w_alt_mlines);
> [...]
>    if (p->w_alt_hlines)
>      for (i = 0; i < p->w_alt_histheight; i++)
>        FreeMline(p->w_alt_hlines + i);
> +  free(p->w_alt_hlines);

It seems to me that the FreeMline() calls make the free() calls redundant.
Am I wrong?

- Eric

reply via email to

[Prev in Thread] Current Thread [Next in Thread]