Ethereal-dev: Re: [Ethereal-dev] [Patch] Ethereal crashes by trying to edit preferences

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Wed, 09 Feb 2005 23:24:35 -0800
Nathan Jennings wrote:

Thanks a ton for including this; it's a huge timesaver.

Please see attached patch.

-Nathan


------------------------------------------------------------------------

Index: gtk/capture_prefs.c
===================================================================
--- gtk/capture_prefs.c	(revision 13296)
+++ gtk/capture_prefs.c	(working copy)
@@ -681,7 +681,7 @@
 	gint i;
 	
 	for (i=0; i < IFOPTS_CLIST_COLS; i++) {
-		if (text[i] != NULL) {
+		if (*text[i] != NULL) {
 			g_free(text[i]);
 			text[i] = NULL;
 		}

That means that if text[i] happens to be a null string, even if it's a g_strdup()ed null string, it won't get freed.

I checked in a change to replace

	text[N] = "";

(for various values of N) with

	text[N] = g_strdup("");

(there was one place where that was already being done).