diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-17 10:43:55 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-12-17 10:43:55 +0100 |
commit | 2181515805e65c37b9db5e0badef2a0a86164234 (patch) | |
tree | 57179ba6359f753e542e6bab7a2729d8ac40706b /runtime | |
parent | c12fd1e65b0403ca60bf51cfc8b5ba487457f731 (diff) | |
download | rsyslog-2181515805e65c37b9db5e0badef2a0a86164234.tar.gz rsyslog-2181515805e65c37b9db5e0badef2a0a86164234.tar.xz rsyslog-2181515805e65c37b9db5e0badef2a0a86164234.zip |
bug fixes in action processing
- bugfix: action processor released mememory too early, resulting in
potential issue in retry cases (but very unlikely due to another
bug, which I also fixed -- only after the fix this problem here
became actually visible).
- bugfix: batches which had actions in error were not properly retried in
all cases
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/batch.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/batch.h b/runtime/batch.h index 68f48d8b..d0504f2b 100644 --- a/runtime/batch.h +++ b/runtime/batch.h @@ -53,9 +53,11 @@ struct batch_obj_s { */ sbool bFilterOK; /* work area for filter processing (per action, reused!) */ sbool bPrevWasSuspended; - void *staticActParams[CONF_OMOD_NUMSTRINGS_MAXSIZE]; + /* following are caches to save allocs if not absolutely necessary */ + uchar *staticActStrings[CONF_OMOD_NUMSTRINGS_MAXSIZE]; /**< for strings */ /* a cache to save malloc(), if not absolutely necessary */ - size_t staticLenParams[CONF_OMOD_NUMSTRINGS_MAXSIZE]; + void *staticActParams[CONF_OMOD_NUMSTRINGS_MAXSIZE]; /**< for anything else */ + size_t staticLenStrings[CONF_OMOD_NUMSTRINGS_MAXSIZE]; /* and the same for the message length (if used) */ /* end action work variables */ }; @@ -152,7 +154,10 @@ batchFree(batch_t *pBatch) { int j; for(i = 0 ; i < pBatch->maxElem ; ++i) { for(j = 0 ; j < CONF_OMOD_NUMSTRINGS_MAXSIZE ; ++j) { - free(pBatch->pElem[i].staticActParams[j]); + /* staticActParams MUST be freed immediately (if required), + * so we do not need to do that! + */ + free(pBatch->pElem[i].staticActStrings[j]); } } free(pBatch->pElem); |