From ce769d23d3a5a39edbab7a57e0c39bb517d7d13d Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 4 Aug 2010 20:57:26 +0200 Subject: [PATCH] Bugfix. --- src/form.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/form.c b/src/form.c index f2e3ea3..183a48c 100644 --- a/src/form.c +++ b/src/form.c @@ -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); -- 2.49.0