changeset 28265:9c7fe51c153b

Avoid an unnecessary alloc/free.
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 15 Sep 2009 15:43:29 +0000
parents f15b14df260d
children 6e18a626ea9c
files pidgin/gtksound.c
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtksound.c	Tue Sep 15 06:42:10 2009 +0000
+++ b/pidgin/gtksound.c	Tue Sep 15 15:43:29 2009 +0000
@@ -617,19 +617,16 @@
 pidgin_sound_is_customized(void)
 {
 	gint i;
-	gchar *path, *file;
+	gchar *path;
+	const char *file;
 
 	for (i = 0; i < PURPLE_NUM_SOUNDS; i++) {
 		path = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", sounds[i].pref);
-		file = g_strdup(purple_prefs_get_path(path));
+		file = purple_prefs_get_path(path);
 		g_free(path);
 
-		if (file && file[0] != '\0'){
-			g_free(file);
+		if (file && file[0] != '\0')
 			return TRUE;
-		}
-
-		g_free(file);
 	}
 
 	return FALSE;