From 285c16c44b8e12aa5b7a7e71855399de7449cae4 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 10 Mar 2016 18:14:14 +0100 Subject: dbfp: introduce dbfp_departure and dbfp_departure_close The dbfp_departure structure stores a single departure with its metadata. The dbfp_departure_close function releases the resources allocated by a dbfp_departure structure, but does not free the structure itself. --- dbfp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'dbfp.c') diff --git a/dbfp.c b/dbfp.c index ec9543b..0b41810 100644 --- a/dbfp.c +++ b/dbfp.c @@ -157,6 +157,19 @@ cleanup: return err; } +void dbfp_departure_close(struct dbfp_departure *departure) +{ + if (!departure) + return; + + free(departure->name); + free(departure->type); + free(departure->stopid); + free(departure->stop); + free(departure->direction); + free(departure->track); +} + static int dbfp_parse(void *contents, size_t len, size_t n, void *data) { XML_Parser parser = (XML_Parser)data; -- cgit v1.2.1