Fix JSON response lifecycle issues 86/22286/1
authorScott Murray <scott.murray@konsulko.com>
Fri, 30 Aug 2019 17:37:11 +0000 (13:37 -0400)
committerScott Murray <scott.murray@konsulko.com>
Fri, 30 Aug 2019 17:44:03 +0000 (13:44 -0400)
commit8396e0353e8dc89c4bb3dbd1221885e51c468ee8
tree98d1a55a1df63eb8a38524aaf991041620131749
parentf14ecdd52975ae365af5ed32648bf55dddacb8d9
Fix JSON response lifecycle issues

Move json_object_put calls to fix lifecycle issues exposed by the
json-c upgrade with OE thud.  In the newer version, an extra put
now triggers an assertion, so rework the affected logic to only call
put when needed in the failed request cases.

Bug-AGL: SPEC-2707

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ia111e408abf515e3ea7b105c66c1339daa759a87
src/api.cpp