From ddea340e665a657bc6be88176130d1221c0dec3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 3 Sep 2012 19:39:43 +0200 Subject: Fix reference counting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding a JSON object to the template output, make sure to increment its reference count. Signed-off-by: Miloslav Trmač --- template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template.c b/template.c index 7940ab24..3cef586c 100644 --- a/template.c +++ b/template.c @@ -303,7 +303,7 @@ rsRetVal tplToJSON(struct template *pTpl, msg_t *pMsg, struct json_object **pjso if(pTpe->data.field.propid == PROP_CEE) { localRet = msgGetCEEPropJSON(pMsg, pTpe->data.field.propName, &jsonf); if(localRet == RS_RET_OK) { - json_object_object_add(json, (char*)pTpe->fieldName, jsonf); + json_object_object_add(json, (char*)pTpe->fieldName, json_object_get(jsonf)); } else { DBGPRINTF("tplToJSON: error %d looking up property\n", localRet); -- cgit v1.2.3