From 41af7e1a0321fa1ddfd0ca05e51849aad22fad45 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 21 Feb 2012 12:10:09 +0100 Subject: bugfix: property $!all-json made rsyslog abort if no normalized data is available --- ChangeLog | 2 ++ runtime/msg.c | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1f1dab1..b0d677e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 6.3.8 [DEVEL] 2012-02-?? +- bugfix: property $!all-json made rsyslog abort if not normalized data + were available - upgraded more plugins to support the new v6 config format: - ommysql - omlibdbi diff --git a/runtime/msg.c b/runtime/msg.c index 66911c16..92de1b9d 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2505,10 +2505,17 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, pRes = glbl.GetLocalHostName(); break; case PROP_CEE_ALL_JSON: - ee_fmtEventToJSON(pMsg->event, &str); - pRes = (uchar*) es_str2cstr(str, "#000"); - es_deleteStr(str); - *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ + if(pMsg->event == NULL) { + if(*pbMustBeFreed == 1) + free(pRes); + pRes = (uchar*) ""; + *pbMustBeFreed = 0; + } else { + ee_fmtEventToJSON(pMsg->event, &str); + pRes = (uchar*) es_str2cstr(str, "#000"); + es_deleteStr(str); + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ + } break; case PROP_CEE: getCEEPropVal(pMsg, propName, &pRes, &bufLen, pbMustBeFreed); -- cgit v1.2.3