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;
|
return NewArray;
|
||||||
|
|
||||||
if (Token::Match(tok2, "fopen ("))
|
if (Token::Match(tok2, "fopen ("))
|
||||||
return FOPEN;
|
return File;
|
||||||
|
|
||||||
if (Token::Match(tok2, "popen ("))
|
if (Token::Match(tok2, "popen ("))
|
||||||
return POPEN;
|
return Pipe;
|
||||||
|
|
||||||
// Userdefined allocation function..
|
// Userdefined allocation function..
|
||||||
std::list<AllocFunc>::const_iterator it = _listAllocFunc.begin();
|
std::list<AllocFunc>::const_iterator it = _listAllocFunc.begin();
|
||||||
|
@ -189,10 +189,10 @@ CheckMemoryLeakClass::AllocType CheckMemoryLeakClass::GetDeallocationType(const
|
||||||
return gMalloc;
|
return gMalloc;
|
||||||
|
|
||||||
if (Token::simpleMatch(tok, std::string("fclose ( " + names + " )").c_str()))
|
if (Token::simpleMatch(tok, std::string("fclose ( " + names + " )").c_str()))
|
||||||
return FOPEN;
|
return File;
|
||||||
|
|
||||||
if (Token::simpleMatch(tok, std::string("pclose ( " + names + " )").c_str()))
|
if (Token::simpleMatch(tok, std::string("pclose ( " + names + " )").c_str()))
|
||||||
return POPEN;
|
return Pipe;
|
||||||
|
|
||||||
return No;
|
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)
|
void CheckMemoryLeakClass::MemoryLeak(const Token *tok, const char varname[], AllocType alloctype, bool all)
|
||||||
{
|
{
|
||||||
if (alloctype == CheckMemoryLeakClass::FOPEN ||
|
if (alloctype == CheckMemoryLeakClass::File ||
|
||||||
alloctype == CheckMemoryLeakClass::POPEN)
|
alloctype == CheckMemoryLeakClass::Pipe)
|
||||||
resourceLeakError(tok, varname);
|
resourceLeakError(tok, varname);
|
||||||
else if (all)
|
else if (all)
|
||||||
memleakallError(tok, varname);
|
memleakallError(tok, varname);
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** What type of allocation are used.. the "Many" means that several types of allocation and deallocation are used */
|
/** 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..
|
// Extra allocation..
|
||||||
class AllocFunc
|
class AllocFunc
|
||||||
|
|
Loading…
Reference in New Issue