-------- Original Message --------
Subject:        memory leak patch for ctwm
Date:   Tue, 3 Jun 2003 10:09:40 +1000
From:   Simon Burge <[EMAIL PROTECTED]>
Organization:   Wasabi Systems, Inc.
To:     Claude Lecommandeur <[EMAIL PROTECTED]>



Hi Claude,

The following patch fixes a memory leak.  My ~2 week old ctwm was
up to about 36MB in size.  The text_prop.value is malloced on calls
to XGetTextProperty, but nothing frees that memory in the call in
util.c:GetWMPropertyString().

Note that I really don't know the first thing about X11 programming
(I'm a kernel person), but it looks like it's ok to free what I'm
freeing where I've done it based on other calls to XGetTextProperty()
I could see.

Cheers,
Simon.
--
Simon Burge                                   <[EMAIL PROTECTED]>
NetBSD Development, Support and Service:   http://www.wasabisystems.com/



--
Claude Lecommandeur           [EMAIL PROTECTED]
EPFL - SIC                    +41 21 693 22 97
1015 Lausanne (Switzerland)   http://slwww.epfl.ch/SIC/SL/info/Claude.html

This signature intentionally left boring.

$NetBSD$

--- util.c.orig Tue Sep 14 23:26:02 1999
+++ util.c
@@ -3897,6 +3897,7 @@ Atom prop;
                     ProgramName, XGetAtomName(dpy, prop), w);
            stringptr = NULL;
        }
+       XFree (text_prop.value);
     } else {
        stringptr = NULL;
     }

Reply via email to