After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 334438 - suspicious free in gailcombobox.c
suspicious free in gailcombobox.c
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: gail
unspecified
Other Linux
: Normal normal
: ---
Assigned To: bill.haneman
bill.haneman
Depends on:
Blocks:
 
 
Reported: 2006-03-13 13:53 UTC by bill.haneman
Modified: 2006-03-14 19:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix the way the g_free is done, and only free when replacing the value. (1.59 KB, patch)
2006-03-14 17:24 UTC, bill.haneman
committed Details | Review

Description bill.haneman 2006-03-13 13:53:36 UTC
gailcombobox.c:244:

  combo_box = GTK_COMBO_BOX (widget);
  gail_combo_box = GAIL_COMBO_BOX (obj);
  g_free (gail_combo_box->name);
  if (gtk_combo_box_get_active_iter (combo_box, &iter))

The free is bogus since we then return gail_combo_box->name unconditionally, even if we don't execute the codepath which assigns a new value.

Instead we should explicitly g_strdup() the string value and g_free() the name in the same block, and use g_value_unset() to clean up the GValue struct used to obtain the name string.
Comment 1 bill.haneman 2006-03-14 17:24:32 UTC
Created attachment 61241 [details] [review]
patch to fix the way the g_free is done, and only free when replacing the value.
Comment 2 Willie Walker 2006-03-14 19:52:35 UTC
Thanks Bill!  This seems to fix a crasher in the Evolution first run wizard.