diff options
author | Miloslav Trmač <mitr@redhat.com> | 2012-09-03 19:39:43 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-04 10:21:03 +0200 |
commit | ddea340e665a657bc6be88176130d1221c0dec3d (patch) | |
tree | d26add6781c9cb6c8ffe9581259a720214d1dd20 | |
parent | 18ff8d54dde1d0c8603d5f06800ce3d55eb86fb2 (diff) | |
download | rsyslog-ddea340e665a657bc6be88176130d1221c0dec3d.tar.gz rsyslog-ddea340e665a657bc6be88176130d1221c0dec3d.tar.bz2 rsyslog-ddea340e665a657bc6be88176130d1221c0dec3d.zip |
Fix reference counting
When adding a JSON object to the template output, make sure to increment
its reference count.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r-- | template.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |