summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
Diffstat (limited to 'binding')
-rw-r--r--binding/bluetooth-map-api.c3
-rw-r--r--binding/bluetooth-map-bmessage.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/binding/bluetooth-map-api.c b/binding/bluetooth-map-api.c
index b0a97d7..512630e 100644
--- a/binding/bluetooth-map-api.c
+++ b/binding/bluetooth-map-api.c
@@ -236,7 +236,7 @@ static void map_subscribe_unsubscribe(afb_req_t request,
gboolean unsub)
{
struct map_state *ns = map_get_userdata(request);
- json_object *jresp = json_object_new_object();
+ json_object *jresp;
const char *value;
afb_event_t event;
int rc;
@@ -268,6 +268,7 @@ static void map_subscribe_unsubscribe(afb_req_t request,
return;
}
+ jresp = json_object_new_object();
afb_req_success_f(request, jresp, "Bluetooth MAP %s to event \"%s\"",
!unsub ? "subscribed" : "unsubscribed",
value);
diff --git a/binding/bluetooth-map-bmessage.c b/binding/bluetooth-map-bmessage.c
index f98d6de..c893649 100644
--- a/binding/bluetooth-map-bmessage.c
+++ b/binding/bluetooth-map-bmessage.c
@@ -197,7 +197,7 @@ static void sanitize_msg(gchar **msg)
json_object *bmessage_parse(const gchar *bmessage)
{
gchar **msg;
- json_object *jresp = json_object_new_object();
+ json_object *jresp;
gboolean ret;
if (!bmessage || !strlen(bmessage))
@@ -208,6 +208,7 @@ json_object *bmessage_parse(const gchar *bmessage)
msg = g_strsplit(bmessage, "\n", -1);
sanitize_msg(msg);
+ jresp = json_object_new_object();
ret = __bmessage_parse(msg, jresp);
if (!ret) {
json_object_put(jresp);