Applied patch 0002-CheckMemoryLeak-renamed-enum-members.patch
Author: php-coder
This commit is contained in:
parent
167ab7ee15
commit
eafb1f823c
|
@ -111,10 +111,10 @@ CheckMemoryLeakClass::AllocType CheckMemoryLeakClass::GetAllocationType(const To
|
|||
return NewArray;
|
||||
|
||||
if (Token::Match(tok2, "fopen ("))
|
||||
return FOPEN;
|
||||
return File;
|
||||
|
||||
if (Token::Match(tok2, "popen ("))
|
||||
return POPEN;
|
||||
return Pipe;
|
||||
|
||||
// Userdefined allocation function..
|
||||
std::list<AllocFunc>::const_iterator it = _listAllocFunc.begin();
|
||||
|
@ -189,10 +189,10 @@ CheckMemoryLeakClass::AllocType CheckMemoryLeakClass::GetDeallocationType(const
|
|||
return gMalloc;
|
||||
|
||||
if (Token::simpleMatch(tok, std::string("fclose ( " + names + " )").c_str()))
|
||||
return FOPEN;
|
||||
return File;
|
||||
|
||||
if (Token::simpleMatch(tok, std::string("pclose ( " + names + " )").c_str()))
|
||||
return POPEN;
|
||||
return Pipe;
|
||||
|
||||
return No;
|
||||
}
|
||||
|
@ -304,8 +304,8 @@ const char * CheckMemoryLeakClass::call_func(const Token *tok, std::list<const T
|
|||
|
||||
void CheckMemoryLeakClass::MemoryLeak(const Token *tok, const char varname[], AllocType alloctype, bool all)
|
||||
{
|
||||
if (alloctype == CheckMemoryLeakClass::FOPEN ||
|
||||
alloctype == CheckMemoryLeakClass::POPEN)
|
||||
if (alloctype == CheckMemoryLeakClass::File ||
|
||||
alloctype == CheckMemoryLeakClass::Pipe)
|
||||
resourceLeakError(tok, varname);
|
||||
else if (all)
|
||||
memleakallError(tok, varname);
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
private:
|
||||
|
||||
/** What type of allocation are used.. the "Many" means that several types of allocation and deallocation are used */
|
||||
enum AllocType { No, Malloc, gMalloc, New, NewArray, FOPEN, POPEN, Many };
|
||||
enum AllocType { No, Malloc, gMalloc, New, NewArray, File, Pipe, Many };
|
||||
|
||||
// Extra allocation..
|
||||
class AllocFunc
|
||||
|
|
Loading…
Reference in New Issue