GNOME Bugzilla – Bug 438456
Potential invalid g_free() on slice-allocated data
Last modified: 2007-05-25 19:38:45 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()
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.
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.
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.)