diff -ru Tk401.000/Pixmap/xpm/CrBufFrP.c Tk401.000.my/Pixmap/xpm/CrBufFrP.c
--- Tk401.000/Pixmap/xpm/CrBufFrP.c	Tue Mar 26 04:33:12 1996
+++ Tk401.000.my/Pixmap/xpm/CrBufFrP.c	Sat Dec 28 21:03:24 1996
@@ -66,6 +66,8 @@
 					   shapeimage, attributes);
 
     /* destroy the ximages */
+    xpmFreeImageData(ximage);
+    xpmFreeImageData(shapeimage);
     if (ximage)
 	XDestroyImage(ximage);
     if (shapeimage)
diff -ru Tk401.000/Pixmap/xpm/CrDatFrP.c Tk401.000.my/Pixmap/xpm/CrDatFrP.c
--- Tk401.000/Pixmap/xpm/CrDatFrP.c	Tue Mar 26 04:32:46 1996
+++ Tk401.000.my/Pixmap/xpm/CrDatFrP.c	Sat Dec 28 21:03:24 1996
@@ -65,6 +65,8 @@
 					 shapeimage, attributes);
 
     /* destroy the ximages */
+    xpmFreeImageData(ximage);
+    xpmFreeImageData(shapeimage);
     if (ximage)
 	XDestroyImage(ximage);
     if (shapeimage)
diff -ru Tk401.000/Pixmap/xpm/create.c Tk401.000.my/Pixmap/xpm/create.c
--- Tk401.000/Pixmap/xpm/create.c	Tue Mar 26 04:43:00 1996
+++ Tk401.000.my/Pixmap/xpm/create.c	Sat Dec 28 21:03:24 1996
@@ -654,6 +654,8 @@
 #undef RETURN
 #define RETURN(status) \
 { \
+    xpmFreeImageData(ximage);		\
+    xpmFreeImageData(shapeimage);	\
     if (ximage) XDestroyImage(ximage); \
     if (shapeimage) XDestroyImage(shapeimage); \
     if (image_pixels) XpmFree(image_pixels); \
@@ -1537,10 +1539,12 @@
     /* create the pixmaps and destroy images */
     if (pixmap_return && ximage) {
 	xpmCreatePixmapFromImage(display, d, ximage, pixmap_return);
+	xpmFreeImageData(ximage);
 	XDestroyImage(ximage);
     }
     if (shapemask_return && shapeimage) {
 	xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return);
+	xpmFreeImageData(shapeimage);
 	XDestroyImage(shapeimage);
     }
     return (ErrorStatus);
@@ -1770,7 +1774,9 @@
     if (hints_cmt)  XpmFree(hints_cmt); \
     if (colors_cmt) XpmFree(colors_cmt); \
     if (pixels_cmt) XpmFree(pixels_cmt); \
+    xpmFreeImageData(ximage);		\
     if (ximage) XDestroyImage(ximage); \
+    xpmFreeImageData(shapeimage);	\
     if (shapeimage) XDestroyImage(shapeimage); \
     if (image_pixels) XpmFree(image_pixels); \
     if (mask_pixels) XpmFree(mask_pixels); \
diff -ru Tk401.000/Pixmap/xpm/CrPFrBuf.c Tk401.000.my/Pixmap/xpm/CrPFrBuf.c
--- Tk401.000/Pixmap/xpm/CrPFrBuf.c	Tue Mar 26 04:16:44 1996
+++ Tk401.000.my/Pixmap/xpm/CrPFrBuf.c	Sat Dec 28 21:03:24 1996
@@ -66,10 +66,12 @@
     /* create the pixmaps and destroy images */
     if (pixmap_return && ximage) {
 	xpmCreatePixmapFromImage(display, d, ximage, pixmap_return);
+	xpmFreeImageData(ximage);
 	XDestroyImage(ximage);
     }
     if (shapemask_return && shapeimage) {
 	xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return);
+	xpmFreeImageData(shapeimage);
 	XDestroyImage(shapeimage);
     }
     return (ErrorStatus);
diff -ru Tk401.000/Pixmap/xpm/CrPFrDat.c Tk401.000.my/Pixmap/xpm/CrPFrDat.c
--- Tk401.000/Pixmap/xpm/CrPFrDat.c	Tue Mar 26 04:16:44 1996
+++ Tk401.000.my/Pixmap/xpm/CrPFrDat.c	Sat Dec 28 21:03:24 1996
@@ -69,10 +69,12 @@
     /* create the pixmaps and destroy images */
     if (pixmap_return && ximage) {
 	xpmCreatePixmapFromImage(display, d, ximage, pixmap_return);
+	xpmFreeImageData(ximage);
 	XDestroyImage(ximage);
     }
     if (shapemask_return && shapeimage) {
 	xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return);
+	xpmFreeImageData(shapeimage);
 	XDestroyImage(shapeimage);
     }
     return (ErrorStatus);
diff -ru Tk401.000/Pixmap/xpm/RdFToP.c Tk401.000.my/Pixmap/xpm/RdFToP.c
--- Tk401.000/Pixmap/xpm/RdFToP.c	Tue Mar 26 04:16:44 1996
+++ Tk401.000.my/Pixmap/xpm/RdFToP.c	Sat Dec 28 21:03:26 1996
@@ -65,10 +65,12 @@
     /* create the pixmaps and destroy images */
     if (pixmap_return && ximage) {
 	xpmCreatePixmapFromImage(display, d, ximage, pixmap_return);
+	xpmFreeImageData(ximage);
 	XDestroyImage(ximage);
     }
     if (shapemask_return && shapeimage) {
 	xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return);
+	xpmFreeImageData(shapeimage);
 	XDestroyImage(shapeimage);
     }
     return (ErrorStatus);
diff -ru Tk401.000/Pixmap/xpm/scan.c Tk401.000.my/Pixmap/xpm/scan.c
--- Tk401.000/Pixmap/xpm/scan.c	Tue Mar 26 04:48:52 1996
+++ Tk401.000.my/Pixmap/xpm/scan.c	Sat Dec 28 21:03:26 1996
@@ -912,6 +912,8 @@
 					     xpmimage, attributes);
 
     /* destroy the ximages */
+    xpmFreeImageData(ximage);
+    xpmFreeImageData(shapeimage);
     if (ximage)
 	XDestroyImage(ximage);
     if (shapeimage)
diff -ru Tk401.000/Pixmap/xpm/WrFFrP.c Tk401.000.my/Pixmap/xpm/WrFFrP.c
--- Tk401.000/Pixmap/xpm/WrFFrP.c	Tue Mar 26 04:40:36 1996
+++ Tk401.000.my/Pixmap/xpm/WrFFrP.c	Sat Dec 28 21:03:26 1996
@@ -65,6 +65,8 @@
 					attributes);
 
     /* destroy the ximages */
+    xpmFreeImageData(ximage);
+    xpmFreeImageData(shapeimage);
     if (ximage)
 	XDestroyImage(ximage);
     if (shapeimage)
diff -ru Tk401.000/Pixmap/xpm/XpmI.h Tk401.000.my/Pixmap/xpm/XpmI.h
--- Tk401.000/Pixmap/xpm/XpmI.h	Sat Sep 28 02:34:56 1996
+++ Tk401.000.my/Pixmap/xpm/XpmI.h	Sat Dec 28 21:03:26 1996
@@ -89,6 +89,11 @@
 		boundCheckingCalloc((long)(nelem),(long) (elsize))
 #endif
 
+#define xpmFreeImageData(image) ((image) && (image)->data 	\
+				 ? (free((void*)(image)->data),	\
+				   (image)->data = NULL)	\
+				 : NULL)
+
 #define XPMMAXCMTLEN BUFSIZ
 typedef struct {
     unsigned int type;
