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 760338 - files-view: Fix double-free of file list in scripts menu
files-view: Fix double-free of file list in scripts menu
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-08 23:57 UTC by Florian Müllner
Modified: 2016-01-13 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
files-view: Fix double-free of file list in scripts menu (1.97 KB, patch)
2016-01-08 23:57 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2016-01-08 23:57:07 UTC
See patch.
Comment 1 Florian Müllner 2016-01-08 23:57:14 UTC
Created attachment 318557 [details] [review]
files-view: Fix double-free of file list in scripts menu

When building the scripts menu, update_directory_in_scripts_menu()
gets the list of files in the script directory, filters out hidden
files and sorts the filtered list by display name. Unlike the filtering
step, which returns a new list with ref'ed files, sorting may change
the start of the list, but not the list's actual content. As a result,
the nautilus_file_list_free() call added in commit 864c815479a25 tries
to free already freed memory (i.e. disposed files), resulting in a
crash when any scripts are found.
Comment 2 Carlos Soriano 2016-01-11 14:50:56 UTC
Review of attachment 318557 [details] [review]:

ugh right, oversight of mine. Thanks!
Comment 3 Florian Müllner 2016-01-13 14:55:49 UTC
Attachment 318557 [details] pushed as b49246d - files-view: Fix double-free of file list in scripts menu