summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyungki Lee <mk5004.lee@samsung.com>2016-04-04 04:56:19 (GMT)
committerMyungki Lee <mk5004.lee@samsung.com>2016-04-04 04:56:41 (GMT)
commit982f58616e9d466a76d13fe23bdbc97c512d8893 (patch)
tree591aafb9ba0ae7d94c2feee4ff729f7c255871ef
parentea29753c920d192f553237558e2def9d1b62a9b8 (diff)
downloadui-gadget-1-982f58616e9d466a76d13fe23bdbc97c512d8893.zip
ui-gadget-1-982f58616e9d466a76d13fe23bdbc97c512d8893.tar.gz
ui-gadget-1-982f58616e9d466a76d13fe23bdbc97c512d8893.tar.bz2
Change-Id: Ibcede25e7e777ff117f1bff9df73f1e52c6a048d Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
-rw-r--r--client/ug-client.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/client/ug-client.c b/client/ug-client.c
index 98dece0..b327eab 100644
--- a/client/ug-client.c
+++ b/client/ug-client.c
@@ -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;
}