rpms/xscreensaver/F-12 xscreensaver-5.10-apple2-memleak.patch, NONE, 1.1 xscreensaver.spec, 1.102, 1.103

Mamoru Tasaka mtasaka at fedoraproject.org
Fri Feb 5 06:18:41 UTC 2010


Author: mtasaka

Update of /cvs/extras/rpms/xscreensaver/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18915/F-12

Modified Files:
	xscreensaver.spec 
Added Files:
	xscreensaver-5.10-apple2-memleak.patch 
Log Message:
* Fri Feb  5 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1:5.10-6
- Fix memleak on analogtv based hacks, especially on apple2


xscreensaver-5.10-apple2-memleak.patch:
 hacks/analogtv.c    |    2 ++
 hacks/apple2-main.c |    7 +++++++
 hacks/apple2.c      |   13 ++++++++++++-
 utils/grabclient.c  |    4 ++++
 4 files changed, 25 insertions(+), 1 deletion(-)

--- NEW FILE xscreensaver-5.10-apple2-memleak.patch ---
--- xscreensaver-5.10/hacks/analogtv.c.meml	2010-02-05 05:47:34.000000000 +0900
+++ xscreensaver-5.10/hacks/analogtv.c	2010-02-05 05:47:34.000000000 +0900
@@ -494,6 +494,8 @@ analogtv_release(analogtv *it)
   it->gc=NULL;
   if (it->n_colors) XFreeColors(it->dpy, it->colormap, it->colors, it->n_colors, 0L);
   it->n_colors=0;
+  /* also free it itself */
+  free(it);
 }
 
 
--- xscreensaver-5.10/hacks/apple2-main.c.meml	2008-02-10 10:34:37.000000000 +0900
+++ xscreensaver-5.10/hacks/apple2-main.c	2010-02-05 05:47:34.000000000 +0900
@@ -569,6 +569,10 @@ image_loaded_cb (Screen *screen, Window 
      image (regardless of whether it started as TrueColor/PseudoColor.)
    */
   pick_a2_subimage (dpy, window, image, buf32, w, h);
+  /* destroy image */
+  free(image->data);
+  image->data = 0;
+  XDestroyImage(image);
 
   /* Then dither the 32bpp image to a 6-color Apple][ colormap.
    */
@@ -905,6 +909,9 @@ launch_text_generator (struct terminal_c
       sprintf (buf, "%.100s: %.100s", progname, program);
       perror(buf);
     }
+
+  free(oprogram);
+  free(program);
 }
 
 static void
--- xscreensaver-5.10/hacks/apple2.c.meml	2006-03-27 14:45:53.000000000 +0900
+++ xscreensaver-5.10/hacks/apple2.c	2010-02-05 05:47:34.000000000 +0900
@@ -702,7 +702,18 @@ apple2_one_frame (apple2_sim_t *sim)
 
           XClearWindow(sim->dpy, sim->window);
 
-          /* #### free sim? */
+          /* free sim */
+          /* This is from a2_make_font */
+          free(sim->text_im->data);
+          sim->text_im->data = 0;
+          XDestroyImage(sim->text_im);
+
+          /* And free else */
+          analogtv_release(sim->dec);
+          free(sim->st);
+          free(sim->inp);
+          free(sim);
+
           return 0;
         }
 
--- xscreensaver-5.10/utils/grabclient.c.meml	2008-02-10 10:57:56.000000000 +0900
+++ xscreensaver-5.10/utils/grabclient.c	2010-02-05 14:19:03.000000000 +0900
@@ -238,6 +238,7 @@ hack_subproc_environment (Display *dpy)
    */
   const char *odpy = DisplayString (dpy);
   char *ndpy = (char *) malloc(strlen(odpy) + 20);
+  static char *old_ndpy;
   strcpy (ndpy, "DISPLAY=");
   strcat (ndpy, odpy);
 
@@ -246,6 +247,9 @@ hack_subproc_environment (Display *dpy)
 #ifdef HAVE_PUTENV
   if (putenv (ndpy))
     abort ();
+
+  free(old_ndpy);
+  old_ndpy = ndpy;
 #endif /* HAVE_PUTENV */
 }
 


Index: xscreensaver.spec
===================================================================
RCS file: /cvs/extras/rpms/xscreensaver/F-12/xscreensaver.spec,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -p -r1.102 -r1.103
--- xscreensaver.spec	2 Feb 2010 16:38:50 -0000	1.102
+++ xscreensaver.spec	5 Feb 2010 06:18:41 -0000	1.103
@@ -5,7 +5,7 @@
 
 
 %define modular_conf  1
-%define fedora_rel    5
+%define fedora_rel    6
 
 %define extrarel      %{nil}
 
@@ -53,6 +53,7 @@ Patch31:         xscreensaver-5.10-apple
 # Not sent to upstream yet, must do later
 # bug 560614
 Patch32:         xscreensaver-5.10-noseguy-segv-with-nofont.patch
+Patch33:         xscreensaver-5.10-apple2-memleak.patch
 #
 # Patches end
 Requires:        xscreensaver-base = %{epoch}:%{version}-%{release}
@@ -210,6 +211,7 @@ This package contains some test programs
 %patch30 -p1 -b .subst
 %patch31 -p1 -b .apple
 %patch32 -p1 -b .noseguy
+%patch33 -p1 -b .meml
 
 change_option(){
    set +x
@@ -679,6 +681,9 @@ exit 0
 %defattr(-,root,root,-)
 
 %changelog
+* Fri Feb  5 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1:5.10-6
+- Fix memleak on analogtv based hacks, especially on apple2
+
 * Wed Feb  3 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1:5.10-5
 - Fix crash on noseguy when X resource is no longer available (bug 560614)
 



More information about the scm-commits mailing list