diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-03 08:49:09 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-03 08:49:09 +0000 |
commit | d0ca3acbf971141b8826d0bb3a184eaadb2804c1 (patch) | |
tree | 7cc63b0d9b595cfe62d39735b71143951d15ca9f /conf.c | |
parent | 47bb1f0d1a0b99116f3864ac5e98e9ca8bb8e921 (diff) | |
download | rsyslog-d0ca3acbf971141b8826d0bb3a184eaadb2804c1.tar.gz rsyslog-d0ca3acbf971141b8826d0bb3a184eaadb2804c1.tar.xz rsyslog-d0ca3acbf971141b8826d0bb3a184eaadb2804c1.zip |
bugfix: memory leaks in script engine
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -68,6 +68,7 @@ static rsRetVal processConfFile(uchar *pConfFile); DEFobjStaticHelpers DEFobjCurrIf(expr) DEFobjCurrIf(ctok) +DEFobjCurrIf(ctok_token) DEFobjCurrIf(module) DEFobjCurrIf(errmsg) DEFobjCurrIf(net) @@ -762,9 +763,12 @@ dbgprintf("calling expression parser, pp %p ('%s')\n", *pline, *pline); */ CHKiRet(ctok.GetToken(tok, &pToken)); if(pToken->tok != ctok_THEN) { + ctok_token.Destruct(&pToken); ABORT_FINALIZE(RS_RET_SYNTAX_ERROR); } + ctok_token.Destruct(&pToken); /* no longer needed */ + /* we are done, so we now need to restore things */ CHKiRet(ctok.Getpp(tok, pline)); CHKiRet(ctok.Destruct(&tok)); @@ -1183,6 +1187,7 @@ CODESTARTObjClassExit(conf) /* release objects we no longer need */ objRelease(expr, CORE_COMPONENT); objRelease(ctok, CORE_COMPONENT); + objRelease(ctok_token, CORE_COMPONENT); objRelease(module, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); objRelease(net, LM_NET_FILENAME); @@ -1197,6 +1202,7 @@ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANG /* request objects we use */ CHKiRet(objUse(expr, CORE_COMPONENT)); CHKiRet(objUse(ctok, CORE_COMPONENT)); + CHKiRet(objUse(ctok_token, CORE_COMPONENT)); CHKiRet(objUse(module, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(net, LM_NET_FILENAME)); /* TODO: make this dependcy go away! */ |