[empathy/gnome-2-26] fix memleak in preferences_widget_sync_string_combo. Previously name was not
- From: Lars-Peter Clausen <larsc src gnome org>
- To: svn-commits-list gnome org
- Subject: [empathy/gnome-2-26] fix memleak in preferences_widget_sync_string_combo. Previously name was not
- Date: Tue, 21 Apr 2009 06:30:57 -0400 (EDT)
commit 0b37bb5c6079e59e42090b5b1d08a1df0fc4d90b
Author: Lars-Peter Clausen <lars metafoo de>
Date: Sat Apr 18 02:10:49 2009 +0200
fix memleak in preferences_widget_sync_string_combo. Previously name was not
freed if it was a match.
---
src/empathy-preferences.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index 0ad8e9b..13367ff 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
*
@@ -688,9 +688,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);
@@ -698,13 +698,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. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]