summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
authorRaquel Medina <raquel.medina@konsulko.com>2019-09-06 18:22:47 +0200
committerraquel medina <raquel.medina@konsulko.com>2019-09-13 10:34:00 +0000
commit57cf5aa7d13c1cf3634eb88bbcf291d9f9973e8c (patch)
tree61f6996e0edfed6d18917f7276d8f1c150ca409f /binding
parenta8400563edde51db455bf04781b74e4fdda020c1 (diff)
afb_event_push most recent implementation calls 'json_object_put', thus affecting the reference count for jresp in agl-service-nfc binding. A call to 'json_object_get' has been added to keep jresp available for the binding. SPEC-2800 Signed-off-by: Raquel Medina <raquel.medina@konsulko.com> Change-Id: I6c9f9df8152918dcd70452465352a848eb195f94 (cherry picked from commit a1a9d26d5b1ffc06f57d5bb61cf0b5012a02084a)
Diffstat (limited to 'binding')
-rw-r--r--binding/afm-nfc-binding.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/binding/afm-nfc-binding.c b/binding/afm-nfc-binding.c
index 5b046f2..72f219f 100644
--- a/binding/afm-nfc-binding.c
+++ b/binding/afm-nfc-binding.c
@@ -217,6 +217,7 @@ static void record_found(const char *tag_name, void *ptr)
pthread_mutex_lock(&mutex);
data->jresp = jresp;
json_object_object_add(jresp, "uid", json_object_new_string(uid));
+ json_object_get(jresp); /* afb_event_push invokes json_object_put */
pthread_mutex_unlock(&mutex);
afb_event_push(presence_event, jresp);