From ad9fe17b0f8e23aabb5a05f73ee95e05db918399 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 18 Apr 2009 02:10:49 +0200 Subject: fix memleak in preferences_widget_sync_string_combo. Previously name was not freed if it was a match. --- src/empathy-preferences.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c index dba87b4df..14bf54a12 100644 --- a/src/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2003-2007 Imendio AB * @@ -696,9 +696,9 @@ preferences_widget_sync_string_combo (const gchar *key, GtkWidget *widget) found = FALSE; if (value && gtk_tree_model_get_iter_first (model, &iter)) { - gchar *name; do { + gchar *name; gtk_tree_model_get (model, &iter, COL_COMBO_NAME, &name, -1); @@ -706,13 +706,10 @@ preferences_widget_sync_string_combo (const gchar *key, GtkWidget *widget) if (strcmp (name, value) == 0) { found = TRUE; gtk_combo_box_set_active_iter (GTK_COMBO_BOX (widget), &iter); - break; - } else { - found = FALSE; } g_free (name); - } while (gtk_tree_model_iter_next (model, &iter)); + } while (!found && gtk_tree_model_iter_next (model, &iter)); } /* Fallback to the first one. */ -- cgit v1.2.3