summaryrefslogtreecommitdiffstats
path: root/omfile.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-12 08:07:30 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-12 08:07:30 +0000
commit230883321cfa7e2dea6d4e5bffe5c3a6b00883ba (patch)
tree6552d04cd3a221a9d2e731fb7a0b0a3c146ffa31 /omfile.c
parentb00cf838bb11fdff8a55c67f07e1045350ec8981 (diff)
downloadrsyslog-230883321cfa7e2dea6d4e5bffe5c3a6b00883ba.tar.gz
rsyslog-230883321cfa7e2dea6d4e5bffe5c3a6b00883ba.tar.xz
rsyslog-230883321cfa7e2dea6d4e5bffe5c3a6b00883ba.zip
- bugfix: not properly initialized data could cause several segfaults if
there were errors in the config file - thanks to varmojfekoj for the patch
Diffstat (limited to 'omfile.c')
-rw-r--r--omfile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/omfile.c b/omfile.c
index cd5e23c4..db2ec3eb 100644
--- a/omfile.c
+++ b/omfile.c
@@ -344,7 +344,8 @@ static void dynaFileFreeCache(instanceData *pData)
dynaFileDelCacheEntry(pData->dynCache, i, 1);
}
- free(pData->dynCache);
+ if(pData->dynCache != NULL)
+ free(pData->dynCache);
}
@@ -605,7 +606,7 @@ BEGINfreeInstance
CODESTARTfreeInstance
if(pData->bDynamicName) {
dynaFileFreeCache(pData);
- } else
+ } else if(pData->fd != -1)
close(pData->fd);
ENDfreeInstance