diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2016-05-31 15:39:07 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2016-05-31 16:59:38 +0900 |
commit | 9a3f14df29442ccc003051efc46e8ec5251a9bd4 (patch) | |
tree | b23235acedba90019dfa43d676ee85046babc0a6 /src | |
parent | d6bad72403d175ad22a9445ca9016729c5d30379 (diff) | |
download | bundle-accepted/tizen/wearable/20160602.022740.tar.gz bundle-accepted/tizen/wearable/20160602.022740.tar.bz2 bundle-accepted/tizen/wearable/20160602.022740.zip |
Fix the bundle_export_to_argv APIsubmit/tizen/20160531.024853accepted/tizen/wearable/20160602.022740accepted/tizen/tv/20160602.022554accepted/tizen/mobile/20160602.023025accepted/tizen/ivi/20160602.022853accepted/tizen/common/20160602.140048
- Allocate memory for the keys of the bundle
Change-Id: I3daf672cfe9119c572566c44933d1d911e425b8a
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bundle.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bundle.c b/src/bundle.c index dea4736..c49e6ed 100644 --- a/src/bundle.c +++ b/src/bundle.c @@ -744,7 +744,7 @@ void _iter_export_to_argv(const char *key, const int type, const keyval_t *kv, unsigned char *encoded_byte = NULL; size_t byte_len = 0; - vi->argv[vi->idx] = (char *)key; + vi->argv[vi->idx] = strdup(key); if (kv->method->encode((struct keyval_t *)kv, &byte, &byte_len) == 0) { /* TODO: encode FAILED! */ BUNDLE_EXCEPTION_PRINT("bundle: FAILED to encode keyval: %s\n", @@ -806,8 +806,8 @@ int bundle_free_exported_argv(int argc, char ***argv) if (!*argv || argc < 2) return BUNDLE_ERROR_INVALID_PARAMETER; - for (i = 3; i < argc; i += 2) - free((*argv)[i]); /* need to free value from g_base64_encode() */ + for (i = 2; i < argc; i++) + free((*argv)[i]); free(*argv); *argv = NULL; |