[GRASS-SVN] r50346 - grass/trunk/lib/db/dbmi_client
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 21 07:35:22 EST 2012
Author: mmetz
Date: 2012-01-21 04:35:22 -0800 (Sat, 21 Jan 2012)
New Revision: 50346
Modified:
grass/trunk/lib/db/dbmi_client/column.c
Log:
db lib: fix memory leak
Modified: grass/trunk/lib/db/dbmi_client/column.c
===================================================================
--- grass/trunk/lib/db/dbmi_client/column.c 2012-01-21 12:31:27 UTC (rev 50345)
+++ grass/trunk/lib/db/dbmi_client/column.c 2012-01-21 12:35:22 UTC (rev 50346)
@@ -54,6 +54,8 @@
dbString table_name;
dbColumn *column;
int ncol, cl, type;
+
+ type = -1;
db_init_string(&table_name);
db_set_string(&table_name, tab);
@@ -67,11 +69,13 @@
column = db_get_table_column(table, cl);
if (strcmp(db_get_column_name(column), col) == 0) {
type = db_get_column_sqltype(column);
- return type;
+ break;
}
}
+
+ db_free_table(table);
- return -1;
+ return type;
}
/*!
More information about the grass-commit
mailing list