Skip to content

Commit 76f29ec

Browse files
Update checkmemoryleak.cpp
1 parent 6367781 commit 76f29ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/checkmemoryleak.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ CheckMemoryLeak::AllocType CheckMemoryLeak::getAllocationType(const Token *tok2,
8787
while (Token::Match(typeTok, "%name% :: %name%"))
8888
typeTok = typeTok->tokAt(2);
8989
const Scope* classScope = nullptr;
90-
if (typeTok->type() && (typeTok->type()->isClassType() || typeTok->type()->isStructType())) {
90+
if (typeTok->type() && (typeTok->type()->isClassType() || typeTok->type()->isStructType() || typeTok->type()->isUnionType())) {
9191
classScope = typeTok->type()->classScope;
9292
} else if (typeTok->function() && typeTok->function()->isConstructor()) {
9393
classScope = typeTok->function()->nestedIn;

0 commit comments

Comments
 (0)