Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > 109d6558f3ddc6a9c51770e52f6247e5 > files > 11

netpbm-10.34-4.1mdv2007.1.src.rpm

--- netpbm-10.34/converter/other/bmptopnm.c.bmptopnm	2006-07-13 18:58:30.000000000 +0200
+++ netpbm-10.34/converter/other/bmptopnm.c	2006-07-13 18:58:30.000000000 +0200
@@ -1262,7 +1262,7 @@ readBmp(FILE *               const ifP, 
         xel **               const colormapP,
         bool                 const verbose) {
 
-    xel * colormap;  /* malloc'ed */
+    xel * colormap = NULL;  /* malloc'ed */
     unsigned int pos;
         /* Current byte position in the BMP file */
 
@@ -1469,7 +1469,7 @@ main(int argc, char ** argv) {
         writeRasterGen(BMPraster, cols, rows, outputType, cBitCount,
                        pixelformat, colormap); 
     }
-    free(colormap);
+    if (colormap) free(colormap);
     free(BMPraster);
 
     return 0;