[Geotiff] [PATCH] Fix memory leak in geo_new.c

Even Rouault even.rouault at mines-paris.org
Tue Oct 2 17:29:02 EDT 2007


While playing with (volontarily) invalid geotiffs, I discovered a memory leak 
in geo_new.c when exiting GTIFNew on a failure.

The following patch fixes it :

Index: frmts/gtiff/libgeotiff/geo_new.c
===================================================================
--- frmts/gtiff/libgeotiff/geo_new.c    (révision 12286)
+++ frmts/gtiff/libgeotiff/geo_new.c    (copie de travail)
@@ -171,6 +171,8 @@

   failure:
     /* Notify of error */
+    if( tempData.tk_asciiParams != NULL )
+        _GTIFFree( tempData.tk_asciiParams );
     GTIFFree (gt);
     return (GTIF *)0;
 }



More information about the Geotiff mailing list