--- gkrellmpc-0.1_beta10/mpd.c.orig 2005-03-04 23:09:52 +0500 +++ gkrellmpc-0.1_beta10/mpd.c 2006-04-09 13:48:23 +0600 @@ -147,7 +147,7 @@ * Note that all key names coming back from MPD are lowercased for consistency before being shoved in the hash */ GHashTable * mpc_mpd_get(gchar * command) { - gchar *line; + gchar *line = NULL; gchar **parts; GHashTable *retval = NULL; gboolean success = TRUE; @@ -163,6 +163,7 @@ retval = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); while (1) { + g_free(line); status = g_io_channel_read_line(mpc_mpd, &line, NULL, NULL, NULL); if (status != G_IO_STATUS_NORMAL) { /* Reading failed */ @@ -193,6 +194,8 @@ } } + g_free(line); + if (!success) { g_hash_table_destroy(retval); retval = NULL;