Fix build warning 93/64593/1 accepted/tizen/common/20160406.143409 accepted/tizen/ivi/20160406.012030 accepted/tizen/mobile/20160406.011904 accepted/tizen/tv/20160406.011948 accepted/tizen/wearable/20160406.012009 submit/tizen/20160405.001024
authorMyungki Lee <mk5004.lee@samsung.com>
Mon, 4 Apr 2016 04:56:19 +0000 (13:56 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Mon, 4 Apr 2016 04:56:41 +0000 (13:56 +0900)
Change-Id: Ibcede25e7e777ff117f1bff9df73f1e52c6a048d
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
client/ug-client.c

index 98dece098359c5589775e4bea490f54efb148707..b327eabfdb9c36f849357d5bca1780db71834083 100644 (file)
@@ -602,7 +602,7 @@ static int update_argument(const char *optarg, struct appdata *ad)
 {
        const char *key;
        const char *val;
-       char *saveptr;
+       char *saveptr = NULL;
 
        key = strtok_r((char *)optarg, ",", &saveptr);
        if (!key)
@@ -610,10 +610,12 @@ static int update_argument(const char *optarg, struct appdata *ad)
 
        val = optarg + strlen(key) + 1;
 
-       if (!ad->data)
+       if (!ad->data) {
                ad->data = bundle_create();
-       if (!ad->data)
-               return -1;
+               if (!ad->data)
+                       return -1;
+       }
+
        bundle_add_str(ad->data, key, val);
        return 0;
 }