Explorar o código

db lib: fix symptom of memory leak, not (yet) cause

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50362 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz %!s(int64=13) %!d(string=hai) anos
pai
achega
4531f2158c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      lib/db/dbmi_client/select.c

+ 2 - 2
lib/db/dbmi_client/select.c

@@ -132,7 +132,7 @@ int db_select_int(dbDriver * driver, const char *tab, const char *col,
     G_debug(3, "  SQL: %s", buf);
     G_debug(3, "  SQL: %s", buf);
 
 
     db_init_string(&stmt);
     db_init_string(&stmt);
-    db_append_string(&stmt, buf);
+    db_set_string(&stmt, buf);
 
 
     if (db_open_select_cursor(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
     if (db_open_select_cursor(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
 	return (-1);
 	return (-1);
@@ -224,7 +224,7 @@ int db_select_value(dbDriver * driver, const char *tab, const char *key,
     G_zero(val, sizeof(dbValue));
     G_zero(val, sizeof(dbValue));
     sprintf(buf, "SELECT %s FROM %s WHERE %s = %d\n", col, tab, key, id);
     sprintf(buf, "SELECT %s FROM %s WHERE %s = %d\n", col, tab, key, id);
     db_init_string(&stmt);
     db_init_string(&stmt);
-    db_append_string(&stmt, buf);
+    db_set_string(&stmt, buf);
 
 
     if (db_open_select_cursor(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
     if (db_open_select_cursor(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
 	return (-1);
 	return (-1);