! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce_backdrop_image_data_release tries to null a pointer given as argument af...
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Mario Rugiero 2014-05-06 13:19:00 CEST
In xfce_backdrop_image_data_release, at the end, after freeing it tries to null image_data. It isn't harmful on itself, as it has no effect whatsoever, but could lead to double frees or reading freed memory if it's used assuming this actually has any effect. I can think of three possible fixes, and both imply the review of every call to the function, I lack the time to do so right now but will do it later if someone asks me too (otherwise, I'll assume the maintainer will take a look). Fix one would be to keep the freeing as it is and nullifying after every call (ugly, IMO), fix two would be making the caller free image_data after use (IMO, the sanest solution) and fix three would be to pass a pointer to the pointer, so the contents could be freed (the caller would pass a reference, of course) and nullified effectively.
Comment 1 Eric Koegel editbugs 2014-05-29 18:48:42 CEST
You're absolutely right. I've fixed it in http://git.xfce.org/xfce/xfdesktop/commit/?id=c2e627b4288ac6f459ea8428a4fa0bd83e804349
I went with option 2 since it is the best. Thanks for reporting this!

Bug #10872

Reported by:
Mario Rugiero
Reported on: 2014-05-06
Last modified on: 2014-05-29

People

Assignee:
Eric Koegel
CC List:
1 user

Version

Version:
Unspecified

Attachments

Additional information