summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2018-04-19 04:19:51 -0500
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2018-07-18 18:22:27 +0200
commit6d6ae80522c37f4a42f7d29e956b392cc345532c (patch)
tree7052ae2873ec659ae798ef70e8c59eae3f74e405
parent04ca0cd31285d82ea07677c6e42d79e1dd3bccbd (diff)
downloadnautilus-6d6ae80522c37f4a42f7d29e956b392cc345532c.tar.gz
window-slot: Clear pending_selection after freeing it
This might not be the case when handling archive files, in fact we were freeing the list and assigning it to a new value for non-archive files, but in case of archives the list was just freed and the invalid pointer kept around, potentially causing a later crash.
-rw-r--r--src/nautilus-window-slot.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 39e9380db..7b272442c 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1592,11 +1592,7 @@ handle_regular_file_if_needed (NautilusWindowSlot *self,
if ((parent_file != NULL) &&
nautilus_file_get_file_type (file) == G_FILE_TYPE_REGULAR)
{
- if (priv->pending_selection != NULL)
- {
- nautilus_file_list_free (priv->pending_selection);
- }
-
+ g_clear_pointer (&priv->pending_selection, nautilus_file_list_free);
g_clear_object (&priv->pending_location);
g_clear_object (&priv->pending_file_to_activate);
g_free (priv->pending_scroll_to);