[MessagePort] Fix for temporary object returned. 39/128539/1
authorTomasz Marciniak <t.marciniak@samsung.com>
Wed, 10 May 2017 09:45:37 +0000 (11:45 +0200)
committerTomasz Marciniak <t.marciniak@samsung.com>
Wed, 10 May 2017 09:45:37 +0000 (11:45 +0200)
[Bug] rvalue objects were returned instead of
reference to picojson string.

[Verification] Code compiles.
TCT pass rate 100% (51/51/0/0/0)

Change-Id: I30b6c3f3d2ec4730f2e810a66d1b6ebb17f5a418
Signed-off-by: Tomasz Marciniak <t.marciniak@samsung.com>
src/messageport/messageport_instance.cc

index 60b9911..36aa678 100755 (executable)
@@ -410,7 +410,7 @@ void MessageportInstance::RemoteMessagePortSendmessage
       size_t i = 0;
 
       for (auto iter = value_array.begin(); iter != value_array.end(); ++iter, ++i) {
-        arr[i] = iter->to_str().c_str();
+        arr[i] = iter->get<std::string>().c_str();
       }
 
       bundle_add_str_array(bundle, (*it).get("key").to_str().c_str(), arr, size);