bugGNU Screen - Bugs: bug #16483, Memory Leak in FreeAltScreen

 
 

bug #16483: Memory Leak in FreeAltScreen

Submitted by:  None
Submitted on:  Tue 02 May 2006 09:52:17 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: None
Fixed Release: NonePlanned Release: None
Work Required: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

 Spam posted by an anonymous
 Spam posted by an anonymous
Tue 02 May 2006 12:22:51 PM UTC, comment #1:

Applied (free calls moved into the "if").
Thanks!

Michael Schröder <mls>
Project Administrator
Tue 02 May 2006 09:52:17 AM UTC, original submission:

From: "Daniel De Graaf" <danieldegraaf@gmail.com>
To: "Screen development" <screen-devel@gnu.org>
Subject: Re: [screen-devel] Memory Leak in FreeAltScreen
Date: Mon, 1 May 2006 18:34:29 -0500
Sender: screen-devel-bounces+jw=cs.fau.de@gnu.org

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: base64, Size: 1.0K --]

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 <eswald@gmail.com> 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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by micahcowan (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 09 Jul 2008 07:34:11 AM UTCNoneAttached File-=>Added powered_php_80x15.png, #16073
    Sun 15 Jun 2008 05:32:28 AM UTCmicahcowanOpen/ClosedOpen=>Closed
    Tue 02 May 2006 12:22:51 PM UTCmlsStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1