Selaa lähdekoodia

libgis: fix memory leak in G_zlib_compress()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61423 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 10 vuotta sitten
vanhempi
commit
a3c95519e2
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      lib/gis/flate.c

+ 1 - 0
lib/gis/flate.c

@@ -365,6 +365,7 @@ G_zlib_compress(const unsigned char *src, int src_sz, unsigned char *dst,
     nbytes = buf_sz - c_stream.avail_out;
     if (nbytes > dst_sz) {	/* Not enough room to copy output */
 	G_free(buf);
+	deflateEnd(&c_stream);
 	return -2;
     }
     /* Copy the data from buf to dst */