[nautilus] properties-window: fix use-after-free on destroy



commit bbc2d59f16a0f175242889dce9764ad5aafb0714
Author: Pavel Vasin <rat4vier gmail com>
Date:   Tue Jan 1 17:22:43 2013 +0400

    properties-window: fix use-after-free on destroy
    
    stop_deep_count_for_file() removes from deep_count_files list
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691004

 src/nautilus-properties-window.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 71c236e..10a889f 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -5236,11 +5236,9 @@ real_destroy (GtkWidget *object)
 		g_source_remove (window->details->deep_count_spinner_timeout_id);
 	}
 
-	for (l = window->details->deep_count_files; l != NULL; l = l->next) {
-		stop_deep_count_for_file (window, l->data);
+	while (window->details->deep_count_files) {
+		stop_deep_count_for_file (window, window->details->deep_count_files->data);
 	}
-	g_list_free (window->details->deep_count_files);
-	window->details->deep_count_files = NULL;
 
 	window->details->name_field = NULL;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]