[GRASS-SVN] r34287 - grass/branches/develbranch_6/raster/r.terraflow

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 14 10:05:44 EST 2008


Author: neteler
Date: 2008-11-14 10:05:44 -0500 (Fri, 14 Nov 2008)
New Revision: 34287

Modified:
   grass/branches/develbranch_6/raster/r.terraflow/main.cc
Log:
glynn: Allocate region before use (merge from trunk, r34285)

Modified: grass/branches/develbranch_6/raster/r.terraflow/main.cc
===================================================================
--- grass/branches/develbranch_6/raster/r.terraflow/main.cc	2008-11-14 13:26:38 UTC (rev 34286)
+++ grass/branches/develbranch_6/raster/r.terraflow/main.cc	2008-11-14 15:05:44 UTC (rev 34287)
@@ -476,12 +476,13 @@
   opt = (userOptions*)malloc(sizeof(userOptions));
   assert(opt);
 
+  region = (struct Cell_head*)malloc(sizeof(struct Cell_head));
+  assert(region);
+
   parse_args(argc, argv);
   check_args();
 
   /* get the current region and dimensions */  
-  region = (struct Cell_head*)malloc(sizeof(struct Cell_head));
-  assert(region);
   if (G_get_set_window(region) == -1) {
     G_fatal_error("r.terraflow: error getting current region");
   }



More information about the grass-commit mailing list