From baf429be157b26f9a3126914a71a77f53afad411 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Tue, 8 Apr 2014 11:23:02 +0100 Subject: split_settings_location: Initialise the 'first' pointer. Otherwise it points to random memory which leads to undefined behaviour. --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index e6d5194..d1c69a2 100644 --- a/src/utils.c +++ b/src/utils.c @@ -52,7 +52,7 @@ split_settings_location(const gchar* location, gchar** zone, gchar** name) if(location_dup != NULL) g_strstrip(location_dup); - gchar* first; + gchar* first = NULL; if(location_dup && (first = strchr(location_dup, ' '))) *first = '\0'; -- cgit v1.2.3