[GRASS-SVN] r46950 - grass/trunk/db/drivers/dbf
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 4 04:17:39 EDT 2011
Author: mmetz
Date: 2011-07-04 01:17:39 -0700 (Mon, 04 Jul 2011)
New Revision: 46950
Modified:
grass/trunk/db/drivers/dbf/cursor.c
Log:
fix dbf memory leak
Modified: grass/trunk/db/drivers/dbf/cursor.c
===================================================================
--- grass/trunk/db/drivers/dbf/cursor.c 2011-07-04 08:05:40 UTC (rev 46949)
+++ grass/trunk/db/drivers/dbf/cursor.c 2011-07-04 08:17:39 UTC (rev 46950)
@@ -47,6 +47,8 @@
return c;
}
+ c->st = NULL;
+ c->cols = NULL;
/* tokenize it */
c->token = db_new_token(c);
if (c->token < 0) {
@@ -62,5 +64,7 @@
{
db_drop_token(c->token);
sqpFreeStmt(c->st);
+ if (c->cols)
+ G_free(c->cols);
G_free(c);
}
More information about the grass-commit
mailing list