[GRASS-SVN] r67153 - grass/trunk/vector/v.out.lidar

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 15 08:42:36 PST 2015


Author: wenzeslaus
Date: 2015-12-15 08:42:36 -0800 (Tue, 15 Dec 2015)
New Revision: 67153

Modified:
   grass/trunk/vector/v.out.lidar/main.c
Log:
v.out.lidar: check the right variable for null

Fixes Coverity CID 1341834.


Modified: grass/trunk/vector/v.out.lidar/main.c
===================================================================
--- grass/trunk/vector/v.out.lidar/main.c	2015-12-15 15:07:14 UTC (rev 67152)
+++ grass/trunk/vector/v.out.lidar/main.c	2015-12-15 16:42:36 UTC (rev 67153)
@@ -71,19 +71,15 @@
 static void open_database(struct Map_info *vector, int field,
                           dbDriver ** driver, struct field_info **f_info)
 {
-    struct field_info *f_info_tmp;
-
-    f_info_tmp = Vect_get_field(vector, field);
-    dbDriver *driver_tmp;
-
-    if (f_info == NULL) {
+    struct field_info *f_info_tmp = Vect_get_field(vector, field);
+    if (f_info_tmp == NULL) {
         /* not ideal message since we don't know the original name of
          * the field in case of OGR */
         G_fatal_error(_("Database connection not defined for layer <%d>"),
                       field);
     }
 
-    driver_tmp =
+    dbDriver *driver_tmp =
         db_start_driver_open_database(f_info_tmp->driver,
                                       f_info_tmp->database);
     if (driver_tmp == NULL)



More information about the grass-commit mailing list