aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--helloworld-skeleton/helloworld-service-binding.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/helloworld-skeleton/helloworld-service-binding.c b/helloworld-skeleton/helloworld-service-binding.c
index a39da57..741f955 100644
--- a/helloworld-skeleton/helloworld-service-binding.c
+++ b/helloworld-skeleton/helloworld-service-binding.c
@@ -36,7 +36,7 @@ static void pingSample(afb_req_t request)
static void testArgsSample(afb_req_t request)
{
json_object *tmpJ;
- json_object *res = json_object_new_object();
+ json_object *res = NULL;
json_object *queryJ = afb_req_json(request);
json_bool success = json_object_object_get_ex(queryJ, "cezam", &tmpJ);
@@ -51,6 +51,7 @@ static void testArgsSample(afb_req_t request)
}
if (strncmp(json_object_get_string(tmpJ), "open", 4) == 0) {
+ res = json_object_new_object();
json_object_object_add(res, "code", json_object_new_int(123456789));
afb_req_success(request, res, NULL);
return;