astyle
This commit is contained in:
parent
ee5b2a43c7
commit
88d0bd3908
|
@ -764,7 +764,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
|
|||
// if else switch
|
||||
if (tok->str() == "if")
|
||||
{
|
||||
if (alloctype == Fd &&
|
||||
if (alloctype == Fd &&
|
||||
(Token::Match(tok, "if ( %varid% >= 0 )", varid) ||
|
||||
Token::Match(tok, "if ( %varid% != -1 )", varid)))
|
||||
{
|
||||
|
|
|
@ -355,7 +355,7 @@ private:
|
|||
ASSERT_EQUALS(";;alloc;", getcode("char *s; asprintf(&s, \"s: %s\", s);", "s"));
|
||||
ASSERT_EQUALS(";;;", getcode("char *s; asprintf(&p, \"s: %s\", s);", "s"));
|
||||
|
||||
// Since we don't check how the return value is used we must bail out
|
||||
// Since we don't check how the return value is used we must bail out
|
||||
ASSERT_EQUALS("", getcode("char *s; int ret = asprintf(&s, \"xyz\");", "s"));
|
||||
TODO_ASSERT_EQUALS(";;alloc;", getcode("char *s; int ret; ret=asprintf(&s, \"xyz\"); if (ret==-1) return;", "s"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue