summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2017-04-26 14:47:25 +0200
committerLars-Dominik Braun <lars@6xq.net>2017-04-26 14:47:25 +0200
commit2a8865ad0d7c4976f43d99ed258c84ae4f95b0ce (patch)
tree4886a3be10ea73bc5666495f5861f5b98e44ce7c
parent2d057f1f088d66053e9aaa7a6593b0fadc66610d (diff)
downloadpianobar-2a8865ad0d7c4976f43d99ed258c84ae4f95b0ce.tar.gz
pianobar-2a8865ad0d7c4976f43d99ed258c84ae4f95b0ce.tar.bz2
pianobar-2a8865ad0d7c4976f43d99ed258c84ae4f95b0ce.zip
Fix use-after-free when deleting station
Eventcmd uses both, selStation and selSong. Fixes #617.
-rw-r--r--src/ui_act.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ui_act.c b/src/ui_act.c
index e1dbfc0..ee43809 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -240,11 +240,13 @@ BarUiActCallback(BarUiActDeleteStation) {
/* drain playlist */
PianoDestroyPlaylist (PianoListNextP (app->playlist));
app->playlist->head.next = NULL;
+ selSong = NULL;
}
app->nextStation = NULL;
/* XXX: usually we shoudn’t touch cur*, but DELETE_STATION destroys
* station struct */
app->curStation = NULL;
+ selStation = NULL;
}
BarUiActDefaultEventcmd ("stationdelete");
}