repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: e31c9d8da5a84470e6c11e0691cdd0a42a21a233:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit e31c9d8da5a84470e6c11e0691cdd0a42a21a233
Author: Emanuele Giaquinta 
Date:   Sun Dec 12 19:30:10 2010 +0000

    Plug leaks.

diff --git a/Changes b/Changes
index 8b0ca02b9494f6ded10e13ef6ce018642139a9dd..
index ..6cecda01a028f995ec928796ac682cbc25cecb6d 100644
--- a/Changes
+++ b/Changes
@@ -32,6 +32,7 @@ TODO: command line editing when icanon?
           pkg-config that was added to workaround cases like this one.
           Fixes linking when using GNU ld with --as-needed or GNU gold
           (based on patch by Jan Palus).
+        - fix minor memory leaks in urxvt and urxvtd.
         - fix regression in urxvtd that prevented options from being correctly
           set (reported by Michal Vaner).
         - INCOMPATIBLE CHANGE: make OSC 20 simpler and more correct
diff --git a/src/main.C b/src/main.C
index 9d926680ed211fede984f20bf5cf53e9ce99bcea..
index ..6a8dcd755de4521171f3a62ff21e54e9780f7bc0 100644
--- a/src/main.C
+++ b/src/main.C
@@ -1646,6 +1646,8 @@ rxvt_term::get_window_origin (int &x, int &y)
 Pixmap
 rxvt_term::get_pixmap_property (int prop_id)
 {
+  Pixmap pixmap = None;
+
   if (prop_id > 0 && prop_id < NUM_XA)
     if (xa[prop_id])
       {
@@ -1657,10 +1659,11 @@ rxvt_term::get_pixmap_property (int prop_id)
                                          0L, 1L, False, XA_PIXMAP, &atype, &aformat,
                                          &nitems, &bytes_after, &prop);
         if (result == Success && prop && atype == XA_PIXMAP)
-          return *(Pixmap *)prop;
+          pixmap = *(Pixmap *)prop;
+        XFree (prop);
       }

-  return None;
+  return pixmap;
 }

 #ifdef HAVE_BG_PIXMAP
diff --git a/src/rxvtd.C b/src/rxvtd.C
index 3612804e6792c6b77359bcc54836d5e1395c4a68..
index ..889e170dbff5449ab5b5fcbbaf9b9e1606a509c5 100644
--- a/src/rxvtd.C
+++ b/src/rxvtd.C
@@ -102,7 +102,7 @@ unix_listener::unix_listener (const char *sockname)
   sa.sun_family = AF_UNIX;
   strcpy (sa.sun_path, sockname);

-  unlink (rxvt_connection::unix_sockname ());
+  unlink (sockname);

   mode_t omask = umask (0077);

-----END OF PAGE-----