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 782070 - files-view: Fix memory leak
files-view: Fix memory leak
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-05-02 13:43 UTC by Mohammed Sadiq
Modified: 2017-05-02 15:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
files-view: Fix memory leak (776 bytes, patch)
2017-05-02 13:43 UTC, Mohammed Sadiq
none Details | Review
files-view: Fix memory leak (962 bytes, patch)
2017-05-02 14:31 UTC, Mohammed Sadiq
committed Details | Review

Description Mohammed Sadiq 2017-05-02 13:43:50 UTC
.
Comment 1 Mohammed Sadiq 2017-05-02 13:43:58 UTC
Created attachment 350876 [details] [review]
files-view: Fix memory leak
Comment 2 Ernestas Kulik 2017-05-02 14:21:45 UTC
Review of attachment 350876 [details] [review]:

Hey, thanks!

Could you expand the commit message? Explain how that is a leak, for example.

::: src/nautilus-files-view.c
@@ +1450,3 @@
 {
     GtkWidget *dialog;
+    g_autofree gchar *mime_type;

Set this to NULL explicitly. It helps defend against possible bugs.
Comment 3 Mohammed Sadiq 2017-05-02 14:31:31 UTC
Created attachment 350885 [details] [review]
files-view: Fix memory leak

nautilus_file_get_mime_type() returns a newly
allocated string, which should be freed when no longer
required.

using g_autofree() automatically frees the string fixing the leak
Comment 4 Ernestas Kulik 2017-05-02 15:00:42 UTC
Review of attachment 350885 [details] [review]:

LGTM
Comment 5 Ernestas Kulik 2017-05-02 15:13:36 UTC
Attachment 350885 [details] pushed as cfee568 - files-view: Fix memory leak