mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-20 19:27:53 +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>
|
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-tables.c: Add -t flag to specify object type
|
||||||
* src/util/mdb-props.c: Handle any object type, not just tables
|
* 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)
|
void mdb_free_catalog(MdbHandle *mdb)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
MdbCatalogEntry *entry;
|
|
||||||
|
|
||||||
if (!mdb->catalog) return;
|
if (!mdb->catalog) return;
|
||||||
|
for (i=0; i<mdb->catalog->len; i++)
|
||||||
for (i=0; i<mdb->catalog->len; i++) {
|
g_free (g_ptr_array_index(mdb->catalog, i));
|
||||||
entry = g_ptr_array_index(mdb->catalog, i);
|
|
||||||
g_free (entry);
|
|
||||||
}
|
|
||||||
g_ptr_array_free(mdb->catalog, TRUE);
|
g_ptr_array_free(mdb->catalog, TRUE);
|
||||||
mdb->catalog = NULL;
|
mdb->catalog = NULL;
|
||||||
}
|
}
|
||||||
@@ -115,6 +111,11 @@ MdbColumn *col;
|
|||||||
void
|
void
|
||||||
mdb_free_columns(GPtrArray *columns)
|
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);
|
g_ptr_array_free(columns, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,5 +130,10 @@ MdbIndex *idx;
|
|||||||
void
|
void
|
||||||
mdb_free_indices(GPtrArray *indices)
|
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);
|
g_ptr_array_free(indices, TRUE);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user