Re: [gnome-db] gda_init



"Vivien Malerba" <vmalerba gmail com> wrote:

Hi!

> > ==14531== 68 bytes in 4 blocks are definitely lost in loss record 1,262 of 1,449
> > ==14531==    at 0x40244B0: malloc (vg_replace_malloc.c:149)
> > ==14531==    by 0x4F930E5: g_malloc (in /usr/lib/libglib-2.0.so.0.1200.11)
> > ==14531==    by 0x4FA6648: g_strdup (in /usr/lib/libglib-2.0.so.0.1200.11)
> > ==14531==    by 0x504D8F1: gda_column_set_table (gda-column.c:425)

> I get the same kind of information from valgrind. However it does not
> seem to come from Libgda, but rather from valgrind itself
> (vg_replace_malloc.c) or from the libXml.

Are you sure?

# gda_column_init 
column->priv->table = NULL;

# gda_column_finalize

if (column->priv) {
                if (column->priv->default_value)
                        gda_value_free (column->priv->default_value);

                g_free (column->priv);
                column->priv = NULL;
        }

# gda_column_copy
        if (column->priv->table)
                column_copy->priv->table = g_strdup (column->priv->table);


# gda_column_set_table

 if (column->priv->table != NULL)
                g_free (column->priv->table);
        column->priv->table = g_strdup (table);

There are two places where table value is duplicated while none where it could be freed.
It's leak IMO.

Piotras



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]