Freed memory on SQL engine termination

Modified mdb_sql_exit to free the memory allocated for the SQL engine in mdb_sql_init
This commit is contained in:
William Rogers
2015-05-24 18:04:14 -05:00
parent d0472d96ba
commit 4148518906

View File

@@ -457,9 +457,18 @@ void mdb_sql_dump(MdbSQL *sql)
}
void mdb_sql_exit(MdbSQL *sql)
{
mdb_sql_reset(sql); // Free memory
/* Free the memory associated with the SQL engine */
mdb_sql_reset(sql);
g_ptr_array_free(sql->columns, TRUE);
g_ptr_array_free(sql->tables, TRUE);
/* If libmdb has been initialized, terminate it */
if (sql->mdb)
mdb_close(sql->mdb);
/* Cleanup the SQL engine object */
g_free(sql);
}
void mdb_sql_reset(MdbSQL *sql)
{