diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 8c9b3200e18..397ceb8b7d5 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -824,7 +824,7 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable* const vari else if (tok3->str() == "}") { if (indentlevel3 == 0) { - memoryLeak(tok3, variable->name() + "." + tok2->strAt(2), allocType); + memoryLeak(tok3, variable->name() + "." + assignToks.first->str(), allocType); break; } --indentlevel3; diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ab4956243f7..e20ca901f7d 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -3605,17 +3605,8 @@ void Tokenizer::combineOperators() tok->deleteNext(); } } else if (tok->str() == "->") { - // If the preceding sequence is "( & %name% )", replace it by "%name%" - Token *t = tok->tokAt(-4); - if (Token::Match(t, "( & %name% )") && !Token::simpleMatch(t->previous(), ">")) { - t->deleteThis(); - t->deleteThis(); - t->deleteNext(); - tok->str("."); - } else { - tok->str("."); - tok->originalName("->"); - } + tok->str("."); + tok->originalName("->"); } } } diff --git a/test/cfg/bsd.c b/test/cfg/bsd.c index 33db4c30207..d64746d2a3a 100644 --- a/test/cfg/bsd.c +++ b/test/cfg/bsd.c @@ -68,10 +68,11 @@ ssize_t nullPointer_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t o return pwritev(fd,iov,iovcnt,offset); } -// False negative: #9346 +// #9346 void uninitvar_timercmp(struct timeval t) { struct timeval uninit; + // cppcheck-suppress uninitvar (void)timercmp(&t, &uninit, <); (void)timercmp(&uninit, &t, <=); (void)timercmp(&uninit, &uninit, ==);