diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2012-09-17 11:26:09 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2012-09-17 11:26:09 +0200 |
commit | e3d8f497baaf02daeddb060cd986681d0ee208de (patch) | |
tree | bd7f555e89662d0d9a1611e2901892d860e09df1 /src | |
parent | 5b2a121673f573b46eed00ccf9a38ab40ec3708b (diff) | |
download | pianobar-e3d8f497baaf02daeddb060cd986681d0ee208de.tar.gz pianobar-e3d8f497baaf02daeddb060cd986681d0ee208de.tar.bz2 pianobar-e3d8f497baaf02daeddb060cd986681d0ee208de.zip |
Fix history memory leak
With `history = 0` playlist items are discarded, but not freed.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/ui.c | 2 |
2 files changed, 3 insertions, 0 deletions
@@ -301,6 +301,7 @@ static void BarMainLoop (BarApp_t *app) { if (app->playlist != NULL) { PianoSong_t *histsong = app->playlist; app->playlist = app->playlist->next; + histsong->next = NULL; BarUiHistoryPrepend (app, histsong); } if (app->playlist == NULL) { @@ -894,6 +894,8 @@ void BarUiHistoryPrepend (BarApp_t *app, PianoSong_t *song) { PianoDestroyPlaylist (delSong); } } + } else { + PianoDestroyPlaylist (song); } } |