mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-19 18:47:54 +08:00
Fixed a couple of potential memory leaks
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
Fri May 28 06:55:55 CDT 2004 Jeff Smith <whydoubt@yahoo.com>
|
||||
* src/libmdb/mem.c: Fixed a couple of potential memory leaks
|
||||
|
||||
Sun May 2 06:31:17 EDT 2004 Brian Bruns <brian@bruns.com>
|
||||
* src/util/mdb-tables.c: Add -t flag to specify object type
|
||||
* src/util/mdb-props.c: Handle any object type, not just tables
|
||||
|
@@ -72,14 +72,10 @@ void mdb_alloc_catalog(MdbHandle *mdb)
|
||||
void mdb_free_catalog(MdbHandle *mdb)
|
||||
{
|
||||
unsigned int i;
|
||||
MdbCatalogEntry *entry;
|
||||
|
||||
if (!mdb->catalog) return;
|
||||
|
||||
for (i=0; i<mdb->catalog->len; i++) {
|
||||
entry = g_ptr_array_index(mdb->catalog, i);
|
||||
g_free (entry);
|
||||
}
|
||||
for (i=0; i<mdb->catalog->len; i++)
|
||||
g_free (g_ptr_array_index(mdb->catalog, i));
|
||||
g_ptr_array_free(mdb->catalog, TRUE);
|
||||
mdb->catalog = NULL;
|
||||
}
|
||||
@@ -115,6 +111,11 @@ MdbColumn *col;
|
||||
void
|
||||
mdb_free_columns(GPtrArray *columns)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (!columns) return;
|
||||
for (i=0; i<columns->len; i++)
|
||||
g_free (g_ptr_array_index(columns, i));
|
||||
g_ptr_array_free(columns, TRUE);
|
||||
}
|
||||
|
||||
@@ -129,5 +130,10 @@ MdbIndex *idx;
|
||||
void
|
||||
mdb_free_indices(GPtrArray *indices)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (!indices) return;
|
||||
for (i=0; i<indices->len; i++)
|
||||
g_free (g_ptr_array_index(indices, i));
|
||||
g_ptr_array_free(indices, TRUE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user