file_mask_dialog() memory leak fix



Hello,

I noticed a memory leak in file_mask_dialog() in src/filegui.c in the
current CVS. The attached patch should fix it.

The cause of it is that g_strdup()ed def_text_secure is not g_free()d.

greetings,
Jindrich

-- 
Jindrich Novy <jnovy redhat com>, http://people.redhat.com/jnovy/
--- mc-4.6.1-20041108/src/filegui.c.jn	2004-11-03 20:43:17.000000000 +0100
+++ mc-4.6.1-20041108/src/filegui.c	2004-11-08 17:13:03.649027160 +0100
@@ -898,8 +898,11 @@ file_mask_dialog (FileOpContext *ctx, Fi
     *do_background = 0;
   ask_file_mask:
 
-    if ((val = quick_dialog_skip (&Quick_input, SKIP)) == B_CANCEL)
+    if ((val = quick_dialog_skip (&Quick_input, SKIP)) == B_CANCEL) {
+	g_free (def_text_secure);
 	return 0;
+    }
+    g_free (def_text_secure);
 
     if (ctx->follow_links)
 	ctx->stat_func = (mc_stat_fn) mc_stat;


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