浏览代码

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 年之前
父节点
当前提交
a38b6985f4
共有 2 个文件被更改,包括 2 次插入5 次删除
  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)
     if (Map->fInfo.ogr.feature_cache)
 	OGR_F_Destroy(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);
     OGR_DS_Destroy(Map->fInfo.ogr.ds);
     
     
     for (i = 0; i < Map->fInfo.ogr.lines_alloc; i++) {
     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 new feature id (level 2)
    \return offset into file where the feature starts (level 1)
    \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;
     off_t offset;