[GRASS-SVN] r45673 - in grass/trunk/lib/db: dbmi_base dbmi_driver

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 15 13:49:40 EDT 2011


Author: martinl
Date: 2011-03-15 10:49:40 -0700 (Tue, 15 Mar 2011)
New Revision: 45673

Modified:
   grass/trunk/lib/db/dbmi_base/error.c
   grass/trunk/lib/db/dbmi_base/value.c
   grass/trunk/lib/db/dbmi_driver/d_close_cur.c
   grass/trunk/lib/db/dbmi_driver/driver_state.c
Log:
fix r45515 - incorect usage of db_free_string() on `char *`
(merge r45671 from relbr64)


Modified: grass/trunk/lib/db/dbmi_base/error.c
===================================================================
--- grass/trunk/lib/db/dbmi_base/error.c	2011-03-15 17:47:52 UTC (rev 45672)
+++ grass/trunk/lib/db/dbmi_base/error.c	2011-03-15 17:49:40 UTC (rev 45673)
@@ -33,7 +33,7 @@
 void db_set_error_who(const char *me)
 {
     if (who)
-	db_free_string(who);
+	db_free(who);
     who = db_store(me);
 }
 
@@ -59,7 +59,7 @@
     if (s == NULL)
 	s = "<NULL error message>";
     if (err_msg)
-	db_free_string(err_msg);
+	db_free(err_msg);
     err_msg = db_store(s);
     err_flag = 1;
     if (auto_print_errors)

Modified: grass/trunk/lib/db/dbmi_base/value.c
===================================================================
--- grass/trunk/lib/db/dbmi_base/value.c	2011-03-15 17:47:52 UTC (rev 45672)
+++ grass/trunk/lib/db/dbmi_base/value.c	2011-03-15 17:49:40 UTC (rev 45673)
@@ -353,7 +353,6 @@
 	for (i = 0; i < arr->n_values; i++) {
 	    if (arr->ctype == DB_C_TYPE_STRING && arr->value[i].val.s) {
 		db_free_string(arr->value[i].val.s);
-		db_free(arr->value[i].val.s);
 	    }
 	    if (arr->ctype == DB_C_TYPE_DATETIME && arr->value[i].val.t) {
 		db_free(arr->value[i].val.t);

Modified: grass/trunk/lib/db/dbmi_driver/d_close_cur.c
===================================================================
--- grass/trunk/lib/db/dbmi_driver/d_close_cur.c	2011-03-15 17:47:52 UTC (rev 45672)
+++ grass/trunk/lib/db/dbmi_driver/d_close_cur.c	2011-03-15 17:49:40 UTC (rev 45673)
@@ -44,7 +44,7 @@
     db_drop_token(token);
     db_free_cursor(cursor);
     db__drop_cursor_from_driver_state(cursor);
-    db_free(cursor);
+    db_free(cursor); /* ?? */
 
     /* send the return code */
     if (stat != DB_OK) {

Modified: grass/trunk/lib/db/dbmi_driver/driver_state.c
===================================================================
--- grass/trunk/lib/db/dbmi_driver/driver_state.c	2011-03-15 17:47:52 UTC (rev 45672)
+++ grass/trunk/lib/db/dbmi_driver/driver_state.c	2011-03-15 17:49:40 UTC (rev 45673)
@@ -66,8 +66,8 @@
 */
 void db__mark_database_closed(void)
 {
-    db_free_string(state.dbname);
-    db_free_string(state.dbschema);
+    db_free(state.dbname);
+    db_free(state.dbschema);
     state.open = 0;
 }
 



More information about the grass-commit mailing list