Przeglądaj źródła

vlib: fix segfault for linked OGR datasources (double free OGR driver)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@45905 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 lat temu
rodzic
commit
a38b6985f4
2 zmienionych plików z 2 dodań i 5 usunięć
  1. 0 2
      lib/vector/Vlib/close_ogr.c
  2. 2 3
      lib/vector/Vlib/write.c

+ 0 - 2
lib/vector/Vlib/close_ogr.c

@@ -43,8 +43,6 @@ int V1_close_ogr(struct Map_info *Map)
     if (Map->fInfo.ogr.feature_cache)
 	OGR_F_Destroy(Map->fInfo.ogr.feature_cache);
 
-    if (Map->fInfo.ogr.driver)
-	OGR_DS_Destroy(Map->fInfo.ogr.driver);
     OGR_DS_Destroy(Map->fInfo.ogr.ds);
     
     for (i = 0; i < Map->fInfo.ogr.lines_alloc; i++) {

+ 2 - 3
lib/vector/Vlib/write.c

@@ -138,9 +138,8 @@ static int (*Vect_restore_line_array[][3]) () = {
    \return new feature id (level 2)
    \return offset into file where the feature starts (level 1)
  */
-off_t
-Vect_write_line(struct Map_info *Map, int type,
-		const struct line_pnts *points, const struct line_cats *cats)
+off_t Vect_write_line(struct Map_info *Map, int type,
+		      const struct line_pnts *points, const struct line_cats *cats)
 {
     off_t offset;