From 850716ecac01030ebf170accc001894c7b4a307f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 30 Jan 2015 07:55:17 +0100 Subject: [PATCH] Cleanup location_driver.c --- location/location_driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/location/location_driver.c b/location/location_driver.c index ef0655b61d..c2606e7b63 100644 --- a/location/location_driver.c +++ b/location/location_driver.c @@ -82,6 +82,9 @@ const char* config_get_location_driver_options(void) attr.i = 0; + if (!options_l) + return NULL; + for (i = 0; location_driver_find_handle(i); i++) { const char *opt = location_driver_find_ident(i); @@ -91,6 +94,13 @@ const char* config_get_location_driver_options(void) options = (char*)calloc(options_len, sizeof(char)); + if (!options) + { + string_list_free(options_l); + options_l = NULL; + return NULL; + } + string_list_join_concat(options, options_len, options_l, "|"); string_list_free(options_l);