Re: Odd array allocation in GtkAboutDialog.xs



On 25.10.2009 15:16, Emmanuel Rodriguez wrote:
Hi,

I've found a strange memory allocation in GtkAboutDialog.xs and I don't
understand why. Take a look at the following macro:

#define SETTER(outof)                        \
     {                            \
         gint num = items - 1;                \
         (outof) = g_new0 (gchar *, num + 30);        \
         for (i = 0; i < num; i++)            \
             (outof)[i] = SvGChar (ST (1 + i));    \
     }

It allocates and array with 30 extra elements. I don't understand why
such extreme generosity.

Yeah, that doesn't seem to be necessary. I changed it to just '+1' (for NULL-termination) in master now.



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