diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-07 15:21:14 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-07 15:21:14 +0000 |
commit | de23e3ef8ce50975077b39de45076262696639d7 (patch) | |
tree | 4054de71249e5238097de7bbb340982505b689ab /omfile.c | |
parent | de5f0db0add0201e03ca82c576c99bae096bd78a (diff) | |
download | rsyslog-de23e3ef8ce50975077b39de45076262696639d7.tar.gz rsyslog-de23e3ef8ce50975077b39de45076262696639d7.tar.xz rsyslog-de23e3ef8ce50975077b39de45076262696639d7.zip |
applied patch by varmojfekoj two fix two potential segfault situations
Diffstat (limited to 'omfile.c')
-rw-r--r-- | omfile.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -417,7 +417,7 @@ static int prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsg * I *hope* this will be a performance enhancement. */ if( (pData->iCurrElt != -1) - && !strcmp((char*) newFileName, (char*) pCache[pData->iCurrElt])) { + && !strcmp((char*) newFileName, (char*) pCache[pData->iCurrElt]->pName)) { /* great, we are all set */ pCache[pData->iCurrElt]->lastUsed = time(NULL); /* update timestamp for LRU */ return 0; @@ -482,6 +482,7 @@ static int prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsg else logerrorSz("Could not open dynamic file '%s' - discarding message", (char*)newFileName); dynaFileDelCacheEntry(pCache, iFirstFree, 1); + pData->iCurrElt = -1; return -1; } |