]> saetta.ns0.it Git - libgtkform/commitdiff
Bugfix.
authorAndrea Zagli <azagli@libero.it>
Wed, 4 Aug 2010 18:57:26 +0000 (20:57 +0200)
committerAndrea Zagli <azagli@libero.it>
Wed, 4 Aug 2010 18:57:26 +0000 (20:57 +0200)
src/form.c

index f2e3ea392eacd451d6145a9527b5f978c8463d01..183a48c177890b8b69e35f41ae10ef4a867c261e 100644 (file)
@@ -1087,7 +1087,7 @@ GtkFormWidget
 }
 
 /**
- * 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.
@@ -1116,7 +1116,14 @@ GtkWidget
        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);