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 438456 - Potential invalid g_free() on slice-allocated data
Potential invalid g_free() on slice-allocated data
Status: RESOLVED FIXED
Product: gtk-engines
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-engines maintainers
gtk-engines maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-14 22:16 UTC by Carlos Garnacho
Modified: 2007-05-25 19:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.29 KB, patch)
2007-05-14 22:21 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2007-05-14 22:16:22 UTC
I've spotted a couple of places where some GtkBorder data is being extracted from a widget (namely, "indicator-spacing", "default-border" and "default-outside-border") and later freed with g_free(), while they're allocated through GSlice, I'm attaching a patch to use gtk_border_free(), which feels more correct to use here and will use g_slice_free()
Comment 1 Carlos Garnacho 2007-05-14 22:21:17 UTC
Created attachment 88185 [details] [review]
patch

Forgot to say that I managed to trigger this bug showing the GTK+ print dialog using industrial gtk theme, but could also happen on others.
Comment 2 Benjamin Berg 2007-05-15 08:36:14 UTC
Good catch. I would have never noticed this bug as I am running with G_SLIZE=always-malloc currently :-)

I committed your patch, and replaced a g_free with gtk_requisition_free. While this is just a g_free currently I guess that it could be changed in the future.
Comment 3 Morten Welinder 2007-05-25 19:38:45 UTC
For the benefit of people referred here:  Setting G_SLICE=always-malloc will
hide this particular bug at the cost of some slowdown.  (That's G_SLICE,
not G_SLIZE.)