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 779188 - Crash when "Set As Wallpaper"
Crash when "Set As Wallpaper"
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Crashers
master
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-24 17:19 UTC by Felipe Borges
Modified: 2017-02-25 11:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (23.50 KB, text/plain)
2017-02-24 17:19 UTC, Felipe Borges
  Details
file-operations: do not free string literal (999 bytes, patch)
2017-02-24 17:19 UTC, Felipe Borges
none Details | Review
file-operations: do not free string literal (992 bytes, patch)
2017-02-24 21:34 UTC, Felipe Borges
committed Details | Review

Description Felipe Borges 2017-02-24 17:19:24 UTC
Created attachment 346655 [details]
backtrace

Nautilus crashes when trying to set a image as wallpaper.

Steps to reproduce:
1. Right click an image file
2. Select "Set As Wallpaper" option

Actual results:
Crash!
Comment 1 Felipe Borges 2017-02-24 17:19:48 UTC
Created attachment 346656 [details] [review]
file-operations: do not free string literal

The "status" string was using the g_autofree macro to ensure its
automatic cleanup, but its attributions were all string literals.

We should live by the mantra "WE SHALL NEVER FREE MEMORY THAT WE
DIDN'T MALLOC(ED)".
Comment 2 Ernestas Kulik 2017-02-24 19:04:22 UTC
Review of attachment 346656 [details] [review]:

Oops. Thanks!

::: src/nautilus-file-operations.c
@@ +3646,3 @@
     CommonJob *job;
     gboolean is_move;
+    gchar *status = NULL;

The assignment here sticks out, might as well remove it.
Comment 3 Felipe Borges 2017-02-24 21:34:05 UTC
Created attachment 346670 [details] [review]
file-operations: do not free string literal

The "status" string was using the g_autofree macro to ensure its
automatic cleanup, but its attributions were all string literals.

We should live by the mantra "WE SHALL NEVER FREE MEMORY THAT WE
DIDN'T MALLOC(ED)".
Comment 4 Ernestas Kulik 2017-02-25 06:54:17 UTC
Review of attachment 346670 [details] [review]:

LGTM
Comment 5 Felipe Borges 2017-02-25 11:30:33 UTC
thanks!

Attachment 346670 [details] pushed as 870179b - file-operations: do not free string literal