001711f
--- netpbm-10.32/converter/other/bmptopnm.c.bmptopnm	2006-02-27 15:02:02.000000000 +0100
001711f
+++ netpbm-10.32/converter/other/bmptopnm.c	2006-02-27 15:07:31.000000000 +0100
001711f
@@ -1248,7 +1248,7 @@ readBmp(FILE *               const ifP, 
751dd22
         xel **               const colormapP,
751dd22
         bool                 const verbose) {
751dd22
 
751dd22
-    xel * colormap;  /* malloc'ed */
751dd22
+    xel * colormap = NULL;  /* malloc'ed */
751dd22
     unsigned int pos;
001711f
         /* Current byte position in the BMP file */
751dd22
 
001711f
@@ -1455,7 +1455,7 @@ main(int argc, char ** argv) {
001711f
         writeRasterGen(BMPraster, cols, rows, outputType, cBitCount,
001711f
                        pixelformat, colormap); 
001711f
     }
751dd22
-    free(colormap);
751dd22
+    if (colormap) free(colormap);
751dd22
     free(BMPraster);
751dd22
 
001711f
     return 0;