summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--binding/bluetooth-api.c2
-rw-r--r--binding/bluetooth-conf.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c
index 3fcf841..2bcddd9 100644
--- a/binding/bluetooth-api.c
+++ b/binding/bluetooth-api.c
@@ -236,6 +236,8 @@ void call_work_destroy_unlocked(struct call_work *cw)
g_free(cw->type_arg);
g_free(cw->method);
g_free(cw->bluez_method);
+ g_free(cw->agent_data.fixed_pincode);
+ cw->agent_data.fixed_pincode = NULL;
}
void call_work_destroy(struct call_work *cw)
diff --git a/binding/bluetooth-conf.c b/binding/bluetooth-conf.c
index b4dea34..a5824bb 100644
--- a/binding/bluetooth-conf.c
+++ b/binding/bluetooth-conf.c
@@ -90,8 +90,8 @@ gchar *get_pincode(afb_api_t api)
if (json_object_object_get_ex(response, "value", &val))
pincode = g_strdup(json_object_get_string(val));
- else
- pincode = "1234";
+ if (!pincode)
+ pincode = g_strdup("1234");
json_object_put(response);
return pincode;