summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-03-04 18:46:06 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-03-04 18:46:06 +0100
commit42db7de5968d2db0fa855a9f029f6bccc0a30650 (patch)
treecb5c1f9914593232c4ce6b79342df4dddd46dae6 /runtime
parentbbcbd87ebdafe8a344c375104264a9ebdd3948d5 (diff)
downloadrsyslog-42db7de5968d2db0fa855a9f029f6bccc0a30650.tar.gz
rsyslog-42db7de5968d2db0fa855a9f029f6bccc0a30650.tar.xz
rsyslog-42db7de5968d2db0fa855a9f029f6bccc0a30650.zip
fixed newly introduced memory leak
(bug created 30 minutes ago or so)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/stringbuf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/stringbuf.c b/runtime/stringbuf.c
index 8d52834d..a5dc625a 100644
--- a/runtime/stringbuf.c
+++ b/runtime/stringbuf.c
@@ -707,12 +707,15 @@ int rsCStrCaseInsensitveStartsWithSzStr(cstr_t *pCS1, uchar *psz, size_t iLenSz)
rsRetVal rsCStrSzStrMatchRegex(cstr_t *pCS1, uchar *psz, int iType)
{
regex_t preq;
+ int ret;
DEFiRet;
if(objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK) {
regexp.regcomp(&preq, (char*) rsCStrGetSzStr(pCS1), (iType == 1 ? REG_EXTENDED : 0) | REG_NOSUB);
- CHKiRet(regexp.regexec(&preq, (char*) psz, 0, NULL, 0));
+ ret = regexp.regexec(&preq, (char*) psz, 0, NULL, 0);
regexp.regfree(&preq);
+ if(ret != 0)
+ ABORT_FINALIZE(RS_RET_NOT_FOUND);
} else {
ABORT_FINALIZE(RS_RET_NOT_FOUND);
}