From 948d8231c7d4d47bb25ef6fc83d9a5ac6c8576a6 Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Thu, 5 Apr 2012 13:55:20 +0200 Subject: bugfix: segfault if disk-queue was started up with old queue file Signed-off-by: Rainer Gerhards --- runtime/queue.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/queue.c') 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)); } -- cgit v1.2.3 From a192300aa26484c88aedd306fdb92d7752eee427 Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Thu, 5 Apr 2012 14:18:11 +0200 Subject: bugfix: segfault on startup if $actionqueuefilename was missing for disk queue config Signed-off-by: Rainer Gerhards --- runtime/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/queue.c') diff --git a/runtime/queue.c b/runtime/queue.c index 137c9547..9f318523 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -2119,7 +2119,8 @@ CODESTARTobjDestruct(qqueue) * direct queue - because in both cases we have none... ;) * with a child! -- rgerhards, 2008-01-28 */ - if(pThis->qType != QUEUETYPE_DIRECT && !pThis->bEnqOnly && pThis->pqParent == NULL) + if(pThis->qType != QUEUETYPE_DIRECT && !pThis->bEnqOnly && pThis->pqParent == NULL + && pThis->pWtpReg != NULL) ShutdownWorkers(pThis); if(pThis->bIsDA && getPhysicalQueueSize(pThis) > 0 && pThis->bSaveOnShutdown) { -- cgit v1.2.3