diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-13 11:03:45 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-13 11:03:45 +0100 |
commit | a072dac3638c399303b3308dbb1c5bbdfc59022b (patch) | |
tree | b03b8e7a2fd78aa64abd7ec3bc6819b043577812 /action.c | |
parent | 1cd51a5d5a8a2c662e9ebcdea12b2ae01afd34d3 (diff) | |
parent | 925b060b2932a7f9ddee1e0fcbaa6266ba03d8b1 (diff) | |
download | rsyslog-a072dac3638c399303b3308dbb1c5bbdfc59022b.tar.gz rsyslog-a072dac3638c399303b3308dbb1c5bbdfc59022b.tar.bz2 rsyslog-a072dac3638c399303b3308dbb1c5bbdfc59022b.zip |
Merge branch 'lognorm' + some doc added
Conflicts:
ChangeLog
Diffstat (limited to 'action.c')
-rw-r--r-- | action.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -672,6 +672,8 @@ static rsRetVal prepareDoActionParams(action_t *pAction, msg_t *pMsg, uchar **pp for(i = 0 ; i < pAction->iNumTpls ; ++i) { switch(pAction->eParamPassing) { case ACT_STRING_PASSING: + if(ppMsgs[i] == NULL) + lenMsgs[i] = 0; CHKiRet(tplToString(pAction->ppTpl[i], pMsg, &(ppMsgs[i]), &lenMsgs[i])); break; case ACT_ARRAY_PASSING: @@ -775,13 +777,20 @@ finalize_it: */ switch(pThis->eParamPassing) { case ACT_STRING_PASSING: - /* nothing to do in that case */ + /* nothing to do in this case */ + /* TODO: find a better way of handling this situation, as it + * costs performance to delete this array each time. + */ + for(i = 0 ; i < pThis->iNumTpls ; ++i) { + free(((uchar**)actParams)[i]); + ((uchar**)actParams)[i] = NULL; + } break; case ACT_ARRAY_PASSING: cleanupDoActionParams(pThis, actParams); /* iRet ignored! */ break; case ACT_MSG_PASSING: - /* nothing to do in that case */ + /* (almost) nothing to do in that case */ for(i = 0 ; i < pThis->iNumTpls ; ++i) { ((uchar**)actParams)[i] = NULL; } |