[GRASS-SVN] r34285 - grass/trunk/raster/r.terraflow

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 14 07:36:45 EST 2008


Author: glynn
Date: 2008-11-14 07:36:45 -0500 (Fri, 14 Nov 2008)
New Revision: 34285

Modified:
   grass/trunk/raster/r.terraflow/main.cc
Log:
Allocate region before use


Modified: grass/trunk/raster/r.terraflow/main.cc
===================================================================
--- grass/trunk/raster/r.terraflow/main.cc	2008-11-14 11:26:17 UTC (rev 34284)
+++ grass/trunk/raster/r.terraflow/main.cc	2008-11-14 12:36:45 UTC (rev 34285)
@@ -455,12 +455,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