summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2018-07-06 16:11:25 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-07-08 21:27:48 +0200
commit10ac2105ecc20251b13bdc6f6c78c3e2edb8dfef (patch)
tree8137763bc79ae0f0637f00c6197af68df877f7ac
parent7491c74e40512564bc361618a6f3d7e238b34dea (diff)
afb-api-v3: Fix a bug introduced by 8ca7b69
This bug returned a wrong OpenAPI description and produced a memory leaak. It it could be good to rewrite this part using wrap_json_pack. Change-Id: Ie0cf03e4434f8674273e9fac3c49a0f9c8196eac Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-api-v3.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/afb-api-v3.c b/src/afb-api-v3.c
index 5134c96f..11bc35ff 100644
--- a/src/afb-api-v3.c
+++ b/src/afb-api-v3.c
@@ -135,9 +135,9 @@ static struct json_object *describe_verb_v3(const struct afb_verb_v3 *verb)
a = json_object_new_object();
json_object_object_add(g, "responses", a);
- f = json_object_new_object();
- json_object_object_add(a, "200", f);
- json_object_object_add(f, "description", json_object_new_string(verb->info?:verb->verb));
+ g = json_object_new_object();
+ json_object_object_add(a, "200", g);
+ json_object_object_add(g, "description", json_object_new_string(verb->info?:verb->verb));
return f;
}