From 7453eebabe2f19b7eca6ff79af682dd453b7ea78 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Thu, 31 Jul 2014 18:05:40 +0200
Subject: [PATCH] Fix possible uninitialized used of variable.

---
 src/setting.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/setting.c b/src/setting.c
index 0b6b8da..c9c38c5 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -364,8 +364,8 @@ free:
 static gboolean prepare_setting_value(Setting *prop, void *value, SettingType type, void **newvalue)
 {
     gboolean islist, res = false;
-    int i, vlen;
-    char *p;
+    int vlen, i = 0;
+    char *p = NULL;
 
     if ((type != SETTING_APPEND && type != SETTING_PREPEND && type != SETTING_REMOVE)
         || prop->type == TYPE_BOOLEAN
@@ -449,7 +449,7 @@ static gboolean prepare_setting_value(Setting *prop, void *value, SettingType ty
             *newvalue = g_strconcat(value, prop->value.s, NULL);
         }
         res = true;
-    } else if (type == SETTING_REMOVE) {
+    } else if (type == SETTING_REMOVE && p) {
         char *copy = g_strdup(prop->value.s);
         /* make p to point to the same position in the copy */
         p = copy + (p - prop->value.s);
-- 
2.20.1