[GRASS-dev] sqlite driver: G_free() missing?

Markus Neteler neteler at itc.it
Thu Jul 6 04:12:53 EDT 2006


Hi,

while testing:

 v.random random n=1000000
 v.out.ascii random > random.csv
 v.in.ascii random.csv out=random2

with the sqlite driver, I observed that it eats a lot
of memory. Since v.in.ascii works ok with the dbf driver, the
problem must be in the sqlite driver. Therein I found some memory
allocations but no G_free():

cd db/drivers/sqlite/
grep malloc *
cursor.c:    c = (cursor *) db_malloc(sizeof(cursor));
describe.c:     c->kcols = (int *) G_malloc ( nkcols * sizeof(int) );
error.c:        errMsg = (dbString *) G_malloc(sizeof(dbString));

My malloc knowledge is limited, do we need to add some
G_free() statements there?

thanks

 Markus




More information about the grass-dev mailing list