mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-18 18:22:07 +08:00
Memory leak wrong fix
Free col->sargs Note this patch causes SEGV
This commit is contained in:

committed by
Nirgal Vourgère

parent
a69281e7bf
commit
1d39126de6
@@ -199,11 +199,20 @@ void mdb_append_column(GPtrArray *columns, MdbColumn *in_col)
|
|||||||
}
|
}
|
||||||
void mdb_free_columns(GPtrArray *columns)
|
void mdb_free_columns(GPtrArray *columns)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i, j;
|
||||||
|
MdbColumn *col;
|
||||||
|
|
||||||
if (!columns) return;
|
if (!columns) return;
|
||||||
for (i=0; i<columns->len; i++)
|
for (i=0; i<columns->len; i++) {
|
||||||
g_free (g_ptr_array_index(columns, i));
|
col = (MdbColumn *) g_ptr_array_index(columns, i);
|
||||||
|
if (col->sargs) {
|
||||||
|
for (j=0; j<col->sargs->len; j++) {
|
||||||
|
g_free( g_ptr_array_index(col->sargs, i));
|
||||||
|
}
|
||||||
|
g_ptr_array_free(col->sargs, TRUE);
|
||||||
|
}
|
||||||
|
g_free(col);
|
||||||
|
}
|
||||||
g_ptr_array_free(columns, TRUE);
|
g_ptr_array_free(columns, TRUE);
|
||||||
}
|
}
|
||||||
GPtrArray *mdb_read_columns(MdbTableDef *table)
|
GPtrArray *mdb_read_columns(MdbTableDef *table)
|
||||||
|
Reference in New Issue
Block a user