[common] Fix JsonToBundle implementation. 70/211170/2
authorMichal Michalski <m.michalski2@partner.samsung.com>
Tue, 30 Jul 2019 14:54:12 +0000 (16:54 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Wed, 31 Jul 2019 04:54:48 +0000 (04:54 +0000)
Broken implemenation has slipped through unspotted.
While testing previous change in JsonToBundle the API
installed on device probably has not been updated.

[Verification] UTs were failing and now they are passing.

Change-Id: I6c871ff03a79417a630da1db50f2f7300fca9ca8
Signed-off-by: Michal Michalski <m.michalski2@partner.samsung.com>
src/common/json-utils.cc

index b58486a..8d52373 100644 (file)
@@ -179,7 +179,7 @@ PlatformResult JsonToBundle(const picojson::value& json, bundle** data) {
   }
 
   for (const auto& property : json.get<picojson::object>()) {
-    int ret = BundleAdd(property.first, property.second, *data);
+    int ret = BundleAdd(property.first, property.second, temp);
     if (BUNDLE_ERROR_NONE != ret) {
       LoggerE("BundleAdd failed with error message: %s", get_error_message(ret));
       bundle_free(temp);