mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00
Fix some potential segmentation faults
This commit is contained in:
parent
e6c4050c74
commit
707a7ac399
@ -2,6 +2,7 @@ Thu Jun 16 21:19:37 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||
* src/libmdb/data.c: Fix segmentation fault
|
||||
* src/libmdb/write.c: Fix bug in handling certain 'jump tables'
|
||||
* src/util/mdb-schema.c: Handle 'file not found' case
|
||||
* src/libmdb/catalog.c: Fix some potential segmentation faults
|
||||
|
||||
Mon May 2 07:28:58 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||
* include/mdbtools.h:
|
||||
|
@ -51,7 +51,7 @@ void mdb_free_catalog(MdbHandle *mdb)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (!mdb->catalog) return;
|
||||
if ((!mdb) || (!mdb->catalog)) return;
|
||||
for (i=0; i<mdb->catalog->len; i++)
|
||||
g_free (g_ptr_array_index(mdb->catalog, i));
|
||||
g_ptr_array_free(mdb->catalog, TRUE);
|
||||
@ -68,6 +68,7 @@ GPtrArray *mdb_read_catalog (MdbHandle *mdb, int objtype)
|
||||
char obj_flags[256];
|
||||
int type;
|
||||
|
||||
if (!mdb) return NULL;
|
||||
if (mdb->catalog) mdb_free_catalog(mdb);
|
||||
mdb->catalog = g_ptr_array_new();
|
||||
mdb->num_catalog = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user