}
/**
- * gtk_form_get_objects:
+ * gtk_form_get_widgets:
* @form: a #GtkForm object.
*
* Returns: an array of all the #GtkWidget into the form. Must be free.
while (fields != NULL)
{
l++;
- ret = g_realloc (ret, l * sizeof (GtkWidget *));
+ if (l == 1)
+ {
+ ret = g_malloc (sizeof (GtkWidget *));
+ }
+ else
+ {
+ ret = g_realloc (ret, l * sizeof (GtkWidget *));
+ }
form_widget = gtk_form_field_get_form_widget ((GtkFormField *)fields->data);
widget = gtk_form_widget_get_widget (form_widget);