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 413352 - Variable being freed twice in a row causes segfault
Variable being freed twice in a row causes segfault
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Display
2.17.x
Other All
: Normal critical
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-03-01 07:30 UTC by Sandino Flores-Moreno
Modified: 2007-03-01 18:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Sandino Flores-Moreno 2007-03-01 07:30:58 UTC
Steps to reproduce:
Just execute gnome-display-properties, it will segfault most of the time.

Stack trace:
Look at this code, from control-center-2.17.92/capplets/display/main.c:670

...
      info->was_per_computer = resolution != NULL;
      g_free (resolution);    //__ FIRST

      gtk_widget_show (per_computer_check);

      wrapped = wrap_in_label (per_computer_check, _("Options"));
      gtk_box_pack_start (GTK_BOX (vbox),
                          wrapped, FALSE, FALSE, 0);
      gtk_widget_show (wrapped);

      g_free (resolution);   //__ SECOND
...

As you can see, there is a variable named resolution that is being freed twice, so that causes a segfault.

Other information:
Comment 1 Jens Granseuer 2007-03-01 18:04:01 UTC
Good catch, thanks!

2007-03-01  Jens Granseuer  <jensgr@gmx.net>
        
        * main.c: (create_dialog): fix double-free reported by Sandino
        Flores-Moreno. Closes bug #413352.