summary refs log tree commit diff stats
path: root/src/common/chanopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/chanopt.c')
-rw-r--r--src/common/chanopt.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/common/chanopt.c b/src/common/chanopt.c
index 56d1b1eb..9b7c4f24 100644
--- a/src/common/chanopt.c
+++ b/src/common/chanopt.c
@@ -396,7 +396,7 @@ chanopt_save_one_channel (chanopt_in_memory *co, int fh)
 }
 
 void
-chanopt_save_all (void)
+chanopt_save_all (gboolean flush)
 {
 	int i;
 	int num_saved;
@@ -438,15 +438,21 @@ chanopt_save_all (void)
 		}
 
 cont:
-		g_free (co->network);
-		g_free (co->channel);
-		g_free (co);
+		if (flush)
+		{
+			g_free (co->network);
+			g_free (co->channel);
+			g_free (co);
+		}
 	}
 
 	close (fh);
 
-	g_slist_free (chanopt_list);
-	chanopt_list = NULL;
+	if (flush)
+	{
+		g_slist_free (chanopt_list);
+		chanopt_list = NULL;
+	}
 
 	chanopt_open = FALSE;
 	chanopt_changed = FALSE;