summaryrefslogtreecommitdiff
path: root/libpiano/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpiano/main.c')
-rw-r--r--libpiano/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/libpiano/main.c b/libpiano/main.c
index 52d7a1b..8ec19bb 100644
--- a/libpiano/main.c
+++ b/libpiano/main.c
@@ -84,6 +84,18 @@ void PianoDestroySearchResult (PianoSearchResult_t *searchResult) {
}
}
+/* free single station
+ * @author PromyLOPh
+ * @added 2008-06-12
+ * @public yes
+ * @param station
+ */
+void PianoDestroyStation (PianoStation_t *station) {
+ free (station->name);
+ free (station->id);
+ memset (station, 0, sizeof (station));
+}
+
/* free complete station list
* @author PromyLOPh
* @added 2008-06-09
@@ -94,11 +106,9 @@ void PianoDestroyStations (PianoHandle_t *ph) {
curStation = ph->stations;
while (curStation != NULL) {
- free (curStation->name);
- free (curStation->id);
lastStation = curStation;
curStation = curStation->next;
- memset (lastStation, 0, sizeof (*lastStation));
+ PianoDestroyStation (lastStation);
free (lastStation);
}
ph->stations = NULL;