diff options
author | Tomas Heinrich <theinric@redhat.com> | 2012-04-05 13:55:20 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-04-05 13:55:20 +0200 |
commit | 948d8231c7d4d47bb25ef6fc83d9a5ac6c8576a6 (patch) | |
tree | 29c0afe22aee6533377035f08d58319aa03cf5cc | |
parent | 59c99b2d8b23f8903e2130b7a149981afe1a8bd3 (diff) | |
download | rsyslog-948d8231c7d4d47bb25ef6fc83d9a5ac6c8576a6.tar.gz rsyslog-948d8231c7d4d47bb25ef6fc83d9a5ac6c8576a6.tar.xz rsyslog-948d8231c7d4d47bb25ef6fc83d9a5ac6c8576a6.zip |
bugfix: segfault if disk-queue was started up with old queue file
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | runtime/queue.c | 9 |
2 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 5.8.10 [V5-stable] 2012-??-?? +- bugfix: segfault if disk-queue was started up with old queue file + Thanks to Tomas Heinrich for the patch. - bugfix: memory leak in array passing output module mode --------------------------------------------------------------------------- Version 5.8.9 [V5-stable] 2012-03-15 diff --git a/runtime/queue.c b/runtime/queue.c index 621a4eed..137c9547 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -2018,13 +2018,16 @@ static rsRetVal qqueuePersist(qqueue_t *pThis, int bIsCheckpoint) CHKiRet(obj.EndSerialize(psQIF)); /* now persist the stream info */ - CHKiRet(strm.Serialize(pThis->tVars.disk.pWrite, psQIF)); - CHKiRet(strm.Serialize(pThis->tVars.disk.pReadDel, psQIF)); + if(pThis->tVars.disk.pWrite != NULL) + CHKiRet(strm.Serialize(pThis->tVars.disk.pWrite, psQIF)); + if(pThis->tVars.disk.pReadDel != NULL) + CHKiRet(strm.Serialize(pThis->tVars.disk.pReadDel, psQIF)); /* tell the input file object that it must not delete the file on close if the queue * is non-empty - but only if we are not during a simple checkpoint */ - if(bIsCheckpoint != QUEUE_CHECKPOINT) { + if(bIsCheckpoint != QUEUE_CHECKPOINT + && pThis->tVars.disk.pReadDel != NULL) { CHKiRet(strm.SetbDeleteOnClose(pThis->tVars.disk.pReadDel, 0)); } |