From 35d9d257865103f0c9004908990b27975bfc7696 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 14 Aug 2008 08:52:01 +0200 Subject: Fix reading from freed pointer Introduced by commit 4878f5911d05af7bfa1917daf984dab0fd07eb42 --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index a2a169d..45cbc4c 100644 --- a/src/main.c +++ b/src/main.c @@ -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 -- cgit v1.2.3