Fix low hanging fruit items from valgrind memcheck results, mostly array deletes

This commit is contained in:
Brian Cox 2017-08-25 12:36:15 -07:00
parent 8cec86246f
commit b3bcdbbcd9
5 changed files with 11 additions and 7 deletions

3
src/core/displayencoder.cpp Normal file → Executable file
View File

@ -653,6 +653,9 @@ cEncoder::cEncoder( int e, int f )
cEncoder::~cEncoder()
{
sack_type::iterator itr;
for( itr = m_encodings.begin(); itr != m_encodings.end(); ++itr)
delete *itr;
}
bool cEncoder::RoundTrip() const

1
src/core/hashtable.h Normal file → Executable file
View File

@ -316,6 +316,7 @@ cHashTable<KEY_TYPE, VAL_TYPE, COMPARE_OP, CONVERTER>::~cHashTable()
}
}
}
delete [] mTable;
}
////////////////////////////////////////////////////////////////////////////////

6
src/twparser/yylex.cpp Normal file → Executable file
View File

@ -614,10 +614,10 @@ yy_scan::~yy_scan()
{
if (mustfree) {
mustfree = 0;
delete(yytext);
delete(state);
delete [] yytext;
delete [] state;
#ifdef YY_PRESERVE
delete(save);
delete [] save;
#endif
}
}

6
src/twparser/yyparse.cpp Normal file → Executable file
View File

@ -419,12 +419,12 @@ yy_parse::yy_parse(int sz)
yy_parse::~yy_parse()
{
if (mustfree) {
delete stateStack;
delete valueStack;
delete [] stateStack;
delete [] valueStack;
}
stateStack = (short *) 0;
#if YYDEBUG
delete typeStack;
delete [] typeStack;
#endif
}

2
src/twtest/refcountobj_t.cpp Normal file → Executable file
View File

@ -66,7 +66,7 @@ cRefCountTestObj::~cRefCountTestObj()
mChildren.pop_front();
}
delete mpSomeMem;
delete [] mpSomeMem;
}
void cRefCountTestObj::AddChild(cRefCountTestObj* pChild)