[GRASS-SVN] r50347 - grass/trunk/lib/db/dbmi_client
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 21 08:24:35 EST 2012
Author: mmetz
Date: 2012-01-21 05:24:34 -0800 (Sat, 21 Jan 2012)
New Revision: 50347
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:35:22 UTC (rev 50346)
+++ grass/trunk/lib/db/dbmi_client/column.c 2012-01-21 13:24:34 UTC (rev 50347)
@@ -124,7 +124,7 @@
int db_get_column(dbDriver * Driver, const char *tname, const char *cname,
dbColumn ** Column)
{
- int i, ncols;
+ int i, ncols, ret;
dbTable *Table;
dbColumn *Col;
dbString tabname;
@@ -138,6 +138,7 @@
}
*Column = NULL;
+ ret = DB_FAILED;
ncols = db_get_table_number_of_columns(Table);
G_debug(3, "ncol = %d", ncols);
@@ -146,8 +147,11 @@
Col = db_get_table_column(Table, i);
if (G_strcasecmp(db_get_column_name(Col), cname) == 0) {
*Column = db_copy_column(NULL, Col);
- return DB_OK;
+ ret = DB_OK;
+ break;
}
}
- return DB_OK;
+ db_free_table(Table);
+
+ return ret;
}
More information about the grass-commit
mailing list