core/playlists: Don't leak playlist names while loading
We need to free the playlist name after looking up in case we hit the case where the playlist isn't found. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
cb2af114c5
commit
4250757b83
|
@ -63,12 +63,13 @@ static bool __artist_pl_load(void *data)
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
name = file_readl(&artist_file);
|
name = file_readl(&artist_file);
|
||||||
playlist = __artist_pl_lookup(name);
|
playlist = __artist_pl_lookup(name);
|
||||||
|
g_free(name);
|
||||||
|
|
||||||
if (!playlist)
|
if (!playlist)
|
||||||
continue;
|
continue;
|
||||||
queue_load_flags(&playlist->pl_queue, &artist_file, true);
|
queue_load_flags(&playlist->pl_queue, &artist_file, true);
|
||||||
queue_iter_set(&playlist->pl_queue, &playlist->pl_queue.q_cur,
|
queue_iter_set(&playlist->pl_queue, &playlist->pl_queue.q_cur,
|
||||||
playlist->pl_queue.q_cur.it_pos);
|
playlist->pl_queue.q_cur.it_pos);
|
||||||
g_free(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file_close(&artist_file);
|
file_close(&artist_file);
|
||||||
|
|
|
@ -71,12 +71,13 @@ static bool __lib_pl_load(void *data)
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
name = file_readl(&lib_file);
|
name = file_readl(&lib_file);
|
||||||
playlist = __lib_pl_lookup(name);
|
playlist = __lib_pl_lookup(name);
|
||||||
|
g_free(name);
|
||||||
|
|
||||||
if (!playlist)
|
if (!playlist)
|
||||||
continue;
|
continue;
|
||||||
queue_load_flags(&playlist->pl_queue, &lib_file, true);
|
queue_load_flags(&playlist->pl_queue, &lib_file, true);
|
||||||
queue_iter_set(&playlist->pl_queue, &playlist->pl_queue.q_cur,
|
queue_iter_set(&playlist->pl_queue, &playlist->pl_queue.q_cur,
|
||||||
playlist->pl_queue.q_cur.it_pos);
|
playlist->pl_queue.q_cur.it_pos);
|
||||||
g_free(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file_close(&lib_file);
|
file_close(&lib_file);
|
||||||
|
|
Loading…
Reference in New Issue