summaryrefslogtreecommitdiffstats
path: root/vmop.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-03 08:49:09 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-03 08:49:09 +0000
commitd0ca3acbf971141b8826d0bb3a184eaadb2804c1 (patch)
tree7cc63b0d9b595cfe62d39735b71143951d15ca9f /vmop.c
parent47bb1f0d1a0b99116f3864ac5e98e9ca8bb8e921 (diff)
downloadrsyslog-d0ca3acbf971141b8826d0bb3a184eaadb2804c1.tar.gz
rsyslog-d0ca3acbf971141b8826d0bb3a184eaadb2804c1.tar.xz
rsyslog-d0ca3acbf971141b8826d0bb3a184eaadb2804c1.zip
bugfix: memory leaks in script engine
Diffstat (limited to 'vmop.c')
-rw-r--r--vmop.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vmop.c b/vmop.c
index affa83e7..91f84b91 100644
--- a/vmop.c
+++ b/vmop.c
@@ -59,6 +59,12 @@ rsRetVal vmopConstructFinalize(vmop_t __attribute__((unused)) *pThis)
/* destructor for the vmop object */
BEGINobjDestruct(vmop) /* be sure to specify the object type also in END and CODESTART macros! */
CODESTARTobjDestruct(vmop)
+ if( pThis->opcode == opcode_PUSHSYSVAR
+ || pThis->opcode == opcode_PUSHMSGVAR
+ || pThis->opcode == opcode_PUSHCONSTANT) {
+ if(pThis->operand.pVar != NULL)
+ var.Destruct(&pThis->operand.pVar);
+ }
ENDobjDestruct(vmop)