diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-19 12:33:17 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-19 12:33:17 +0200 |
commit | 294630b88601f139dc49fe3b00f0b639927ac040 (patch) | |
tree | ef80269b243b0427ad8c6d4052104afcabc8e061 /runtime/msg.c | |
parent | 2876bb6118e96a83a9078e426f4995cab15323e2 (diff) | |
download | rsyslog-294630b88601f139dc49fe3b00f0b639927ac040.tar.gz rsyslog-294630b88601f139dc49fe3b00f0b639927ac040.tar.bz2 rsyslog-294630b88601f139dc49fe3b00f0b639927ac040.zip |
bugfix: MsgDup() did not copy CEE structure
This function was called at various places, most importantly during
"last messages repeated n times" processing and omruleset. If CEE(JSON)
data was present, it was lost as part of the copy process.
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 2dfa15f2..1ec93d9e 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -295,6 +295,7 @@ static pthread_mutex_t mutTrimCtr; /* mutex to handle malloc trim */ static int getAPPNAMELen(msg_t *pM, sbool bLockMutex); static rsRetVal jsonPathFindParent(msg_t *pM, uchar *name, uchar *leaf, struct json_object **parent, int bCreate); static uchar * jsonPathGetLeaf(uchar *name, int lenName); +static struct json_object *jsonDeepCopy(struct json_object *src); /* The following functions will support advanced output module @@ -1033,6 +1034,9 @@ msg_t* MsgDup(msg_t* pOld) tmpCOPYCSTR(PROCID); tmpCOPYCSTR(MSGID); + if(pOld->json != NULL) + pNew->json = jsonDeepCopy(pOld->json); + /* we do not copy all other cache properties, as we do not even know * if they are needed once again. So we let them re-create if needed. */ @@ -3854,7 +3858,7 @@ finalize_it: RETiRet; } -static inline struct json_object * +static struct json_object * jsonDeepCopy(struct json_object *src) { struct json_object *dst = NULL, *json; |