diff options
author | unknown <pekka@sama.ndb.mysql.com> | 2007-10-14 16:17:39 +0200 |
---|---|---|
committer | unknown <pekka@sama.ndb.mysql.com> | 2007-10-14 16:17:39 +0200 |
commit | eff940c7314fc72134cbfcafdb1e14040b99c8a9 (patch) | |
tree | 9abf278db120c5c953eee068841739189a529d95 | |
parent | d0d6fb96a634fcb894522d13a366edf073f1e67f (diff) | |
download | mariadb-git-eff940c7314fc72134cbfcafdb1e14040b99c8a9.tar.gz |
ndb - bug#29390: fix mem leak introduced in previous cset
ndb/src/ndbapi/NdbScanFilter.cpp:
fix mem leak on discarded scanfilter
-rw-r--r-- | ndb/src/ndbapi/NdbScanFilter.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index 624122b5c55..58e9f180119 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -22,6 +22,7 @@ #include <Interpreter.hpp> #include <signaldata/AttrInfo.hpp> #include "NdbApiSignal.hpp" +#include "NdbUtil.hpp" #ifdef VM_TRACE #include <NdbEnv.h> @@ -621,12 +622,43 @@ NdbScanFilterImpl::handle_filter_too_large() op->theStatus = m_initial_op_status; // reset interpreter state to initial + + NdbBranch* tBranch = op->theFirstBranch; + while (tBranch != NULL) { + NdbBranch* tmp = tBranch; + tBranch = tBranch->theNext; + op->theNdb->releaseNdbBranch(tmp); + } op->theFirstBranch = NULL; op->theLastBranch = NULL; + + NdbLabel* tLabel = op->theFirstLabel; + while (tLabel != NULL) { + NdbLabel* tmp = tLabel; + tLabel = tLabel->theNext; + op->theNdb->releaseNdbLabel(tmp); + } + op->theFirstLabel = NULL; + op->theLastLabel = NULL; + + NdbCall* tCall = op->theFirstCall; + while (tCall != NULL) { + NdbCall* tmp = tCall; + tCall = tCall->theNext; + op->theNdb->releaseNdbCall(tmp); + } op->theFirstCall = NULL; op->theLastCall = NULL; + + NdbSubroutine* tSubroutine = op->theFirstSubroutine; + while (tSubroutine != NULL) { + NdbSubroutine* tmp = tSubroutine; + tSubroutine = tSubroutine->theNext; + op->theNdb->releaseNdbSubroutine(tmp); + } op->theFirstSubroutine = NULL; op->theLastSubroutine = NULL; + op->theNoOfLabels = 0; op->theNoOfSubroutines = 0; |