http://ftp.x.org/contrib/applications/xscreensaver-3.06.tar.gz
[xscreensaver] / hacks / glx / xpm-ximage.c
index 5913ddddac05b4474b8e34a3a3c20f10badb8ac2..44f64dbf3d97ae2425e03d11ce326fdc9a642045 100644 (file)
@@ -63,6 +63,8 @@ xpm_to_ximage (Display *dpy, Visual *visual, Colormap cmap, char **xpm_data)
   int bpl, wpl;
   XColor colors[255];
 
+  memset (&xpm_image, 0, sizeof(xpm_image));
+  memset (&xpm_info, 0, sizeof(xpm_info));
   result = XpmCreateXpmImageFromData (xpm_data, &xpm_image, &xpm_info);
   if (result != XpmSuccess)
     {
@@ -122,8 +124,10 @@ xpm_to_ximage (Display *dpy, Visual *visual, Colormap cmap, char **xpm_data)
   }
 
   /* I sure hope these only free the contents, and not the args. */
+#if 0  /* Apparently not?  Gotta love those well-documented APIs! */
   XpmFreeXpmImage (&xpm_image);
   XpmFreeXpmInfo (&xpm_info);
+#endif
 
   return ximage;
 }