summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Heinrich <theinric@redhat.com>2012-04-05 13:55:20 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-04-05 13:55:20 +0200
commit948d8231c7d4d47bb25ef6fc83d9a5ac6c8576a6 (patch)
tree29c0afe22aee6533377035f08d58319aa03cf5cc
parent59c99b2d8b23f8903e2130b7a149981afe1a8bd3 (diff)
downloadrsyslog-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--ChangeLog2
-rw-r--r--runtime/queue.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 83e7f4ee..b19dba0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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));
}