aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-09-11 18:32:28 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:57:27 +0200
commit43129f229bc970209695c9438bc70377ed085f1b (patch)
tree3b05c0d2269045935e4397534602a00bd9689a8a /plugins
parent26e4b4b0d7ccc237fc0102103f9ad9ce8fe5c679 (diff)
Free afb call sync json returned object in Hal-Bt
Free forgotten application framework call sync json returned object in Hal-Bt plugin. Change-Id: Ic9680fd735154b21839fad93b4d13a7609009866 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/lib/bluetooth/hal-bt-mixer-link.c3
-rw-r--r--plugins/lib/bluetooth/hal-bt.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/plugins/lib/bluetooth/hal-bt-mixer-link.c b/plugins/lib/bluetooth/hal-bt-mixer-link.c
index 714c4e8..abbd1b7 100644
--- a/plugins/lib/bluetooth/hal-bt-mixer-link.c
+++ b/plugins/lib/bluetooth/hal-bt-mixer-link.c
@@ -65,9 +65,12 @@ int HalBtMixerLinkSetBtStreamingSettings(AFB_ApiT apiHandle, char *mixerApiName,
returnedError ? returnedError : "no_error_string",
MIXER_SET_STREAMED_BT_DEVICE_VERB,
mixerApiName);
+ json_object_put(returnedJ);
return -4;
}
+ json_object_put(returnedJ);
+
if(btStreamStatus)
AFB_ApiInfo(apiHandle, "Bluetooth streamed device changed to hci='%s' address='%s'", hci, btAddress);
else
diff --git a/plugins/lib/bluetooth/hal-bt.c b/plugins/lib/bluetooth/hal-bt.c
index 113c411..04a1f10 100644
--- a/plugins/lib/bluetooth/hal-bt.c
+++ b/plugins/lib/bluetooth/hal-bt.c
@@ -80,7 +80,7 @@ CTLP_CAPI(init, source, argsJ, queryJ)
char *returnedInfo;
- struct json_object *toSendJ, *returnedJ, *returnedBtList = NULL;
+ json_object *toSendJ, *returnedJ, *returnedBtList;
if(! localHalBtPluginData.halBtPluginEnabled) {
AFB_ApiWarning(source->api, "Controller onload initialization of HAL-BT plugin cannot be done because bluetooth is not reachable");
@@ -163,8 +163,10 @@ CTLP_CAPI(init, source, argsJ, queryJ)
BT_MANAGER_SUBSCRIBE_VERB,
BT_MANAGER_API,
returnedInfo);
+ json_object_put(returnedJ);
return -6;
}
+ json_object_put(returnedJ);
if(AFB_ServiceSync(source->api, BT_MANAGER_API, BT_MANAGER_GET_DEVICES_VERB, NULL, &returnedJ)) {
AFB_ApiError(source->api,
@@ -180,12 +182,15 @@ CTLP_CAPI(init, source, argsJ, queryJ)
"Couldn't get bluetooth device list during call to verb '%s' of api '%s'",
BT_MANAGER_GET_DEVICES_VERB,
BT_MANAGER_API);
+ json_object_put(returnedJ);
return -7;
}
if((err = HalBtDataHandleReceivedMutlipleBtDeviceData(&localHalBtPluginData, returnedBtList)))
return (10 * err);
+ json_object_put(returnedJ);
+
if(localHalBtPluginData.selectedBtDevice) {
localHalBtPluginData.btStreamEnabled = 1;