[memprof: 64/76] Saving leak files twice makes memprof crash



commit cc75dffeec5f402bdf0cc1baac6315b2c88beb61
Author: Holger Hans Peter Freyther <zecke selfish org>
Date:   Tue Feb 2 15:26:19 2010 +0100

    Saving leak files twice makes memprof crash
    
    Reported and patched by: Daniel Fredouille
    
    https://bugzilla.gnome.org/show_bug.cgi?id=607358

 src/main.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 02b19ed..b5f4ca2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1101,7 +1101,8 @@ save_leak_cb (GtkWidget *widget)
 		filename = get_filename ("Save Leak Report",
 					 suggestion ? suggestion : "memprof.leak");
 		if (filename) {
-			g_free (suggestion);
+			if (suggestion) 
+				g_free (suggestion);
 			suggestion = filename;
 			
 			leaks_print (pwin->process, pwin->leaks, filename);
@@ -1122,7 +1123,8 @@ save_profile_cb (GtkWidget *widget)
 		filename = get_filename ("Save Profile",
 					 suggestion ? suggestion : "memprof.out");
 		if (filename) {
-			g_free (suggestion);
+			if (suggestion)
+				g_free (suggestion);
 			suggestion = filename;
 			
 			profile_write (pwin->profile, filename);



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