Lines 147-153
Link Here
|
147 |
* Note that all key names coming back from MPD are lowercased for consistency before being shoved in the hash |
147 |
* Note that all key names coming back from MPD are lowercased for consistency before being shoved in the hash |
148 |
*/ |
148 |
*/ |
149 |
GHashTable * mpc_mpd_get(gchar * command) { |
149 |
GHashTable * mpc_mpd_get(gchar * command) { |
150 |
gchar *line; |
150 |
gchar *line = NULL; |
151 |
gchar **parts; |
151 |
gchar **parts; |
152 |
GHashTable *retval = NULL; |
152 |
GHashTable *retval = NULL; |
153 |
gboolean success = TRUE; |
153 |
gboolean success = TRUE; |
Lines 163-168
Link Here
|
163 |
retval = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); |
163 |
retval = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); |
164 |
|
164 |
|
165 |
while (1) { |
165 |
while (1) { |
|
|
166 |
g_free(line); |
166 |
status = g_io_channel_read_line(mpc_mpd, &line, NULL, NULL, NULL); |
167 |
status = g_io_channel_read_line(mpc_mpd, &line, NULL, NULL, NULL); |
167 |
if (status != G_IO_STATUS_NORMAL) { |
168 |
if (status != G_IO_STATUS_NORMAL) { |
168 |
/* Reading failed */ |
169 |
/* Reading failed */ |
Lines 193-198
Link Here
|
193 |
} |
194 |
} |
194 |
} |
195 |
} |
195 |
|
196 |
|
|
|
197 |
g_free(line); |
198 |
|
196 |
if (!success) { |
199 |
if (!success) { |
197 |
g_hash_table_destroy(retval); |
200 |
g_hash_table_destroy(retval); |
198 |
retval = NULL; |
201 |
retval = NULL; |