浏览代码

avoid fclose()ing an already deallocated pointer (https://trac.osgeo.org/grass/ticket/1316)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50189 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 13 年之前
父节点
当前提交
a88c75e4b0
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      raster/r.in.gridatb/file_io.c

+ 2 - 1
raster/r.in.gridatb/file_io.c

@@ -63,7 +63,8 @@ void rdwr_gridatb(void)
 	Rast_put_f_row(fd, cell);
     }
     G_percent(i, cellhd.rows, 2);
-    fclose(fp);
+    if(fp)
+	fclose(fp);
     Rast_close(fd);
 
     Rast_put_cell_title(oname, buf);