summaryrefslogtreecommitdiff
path: root/gtk/decode_as_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-08-25 05:12:58 +0000
committerGuy Harris <guy@alum.mit.edu>2004-08-25 05:12:58 +0000
commitf12213666301dc0b19e80d2b7668f2d90802e0f8 (patch)
tree502ba8acbbb6473bce3f6d4224f27098d2ff8a04 /gtk/decode_as_dlg.c
parent750812d7391676a8b7fce371978a11f95c6873e7 (diff)
downloadwireshark-f12213666301dc0b19e80d2b7668f2d90802e0f8.tar.gz
Don't free something we haven't allocated.
svn path=/trunk/; revision=11829
Diffstat (limited to 'gtk/decode_as_dlg.c')
-rw-r--r--gtk/decode_as_dlg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c
index 95aa44a8d8..d7502c1b15 100644
--- a/gtk/decode_as_dlg.c
+++ b/gtk/decode_as_dlg.c
@@ -614,7 +614,7 @@ decode_change_one_dissector(gchar *table_name, guint selector, GtkWidget *list)
#if GTK_MAJOR_VERSION < 2
if (!GTK_CLIST(list)->selection)
{
- abbrev = "(NULL)";
+ abbrev = NULL;
handle = NULL;
} else {
row = GPOINTER_TO_INT(GTK_CLIST(list)->selection->data);
@@ -625,7 +625,7 @@ decode_change_one_dissector(gchar *table_name, guint selector, GtkWidget *list)
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
if (gtk_tree_selection_get_selected(selection, &model, &iter) == FALSE)
{
- abbrev = "(NULL)";
+ abbrev = NULL;
handle = NULL;
} else {
gtk_tree_model_get(model, &iter, E_LIST_S_PROTO_NAME, &abbrev,
@@ -633,13 +633,14 @@ decode_change_one_dissector(gchar *table_name, guint selector, GtkWidget *list)
}
#endif
- if (strcmp(abbrev, "(default)") == 0) {
+ if (abbrev != NULL && strcmp(abbrev, "(default)") == 0) {
dissector_reset(table_name, selector);
} else {
dissector_change(table_name, selector, handle);
}
#if GTK_MAJOR_VERSION >= 2
- g_free(abbrev);
+ if (abbrev != NULL)
+ g_free(abbrev);
#endif
}