diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-08-14 08:52:01 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-08-14 08:52:01 +0200 |
commit | 35d9d257865103f0c9004908990b27975bfc7696 (patch) | |
tree | dd110371126e09cf209391f609e1e8732e264371 /src | |
parent | 95d3383fd3996c8a181c04379f6ff57a685933d3 (diff) | |
download | pianobar-windows-35d9d257865103f0c9004908990b27975bfc7696.tar.gz pianobar-windows-35d9d257865103f0c9004908990b27975bfc7696.tar.bz2 pianobar-windows-35d9d257865103f0c9004908990b27975bfc7696.zip |
Fix reading from freed pointer
Introduced by commit 4878f5911d05af7bfa1917daf984dab0fd07eb42
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -152,7 +152,7 @@ PianoStation_t **BarSortedStations (PianoStation_t *unsortedStations) { */ PianoStation_t *BarUiSelectStation (PianoHandle_t *ph, const char *prompt) { - PianoStation_t **ss = NULL, **ssCurr = NULL; + PianoStation_t **ss = NULL, **ssCurr = NULL, *retStation; int i = 0; ss = BarSortedStations (ph->stations); @@ -175,8 +175,9 @@ PianoStation_t *BarUiSelectStation (PianoHandle_t *ph, ssCurr++; i--; } + retStation = *ssCurr; free (ss); - return *ssCurr; + return retStation; } /* let user pick one song |