diff --git a/cfg/cppcheck-cfg.rng b/cfg/cppcheck-cfg.rng index d393a6383..9864ba111 100644 --- a/cfg/cppcheck-cfg.rng +++ b/cfg/cppcheck-cfg.rng @@ -35,7 +35,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -570,6 +570,12 @@ + + + [a-zA-Z_][a-zA-Z_0-9:]* + + + [a-zA-Z_][a-zA-Z_0-9:,]* diff --git a/cfg/opencv2.cfg b/cfg/opencv2.cfg index e71d1b007..797035c1e 100644 --- a/cfg/opencv2.cfg +++ b/cfg/opencv2.cfg @@ -5,7 +5,19 @@ + + + + + + + + + + + + @@ -22,11 +34,54 @@ + + + + cv::fastMalloc + cv::fastFree + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + false + + + + + 0: + + false diff --git a/test/cfg/opencv2.cpp b/test/cfg/opencv2.cpp index c6056f40b..505cd83bf 100644 --- a/test/cfg/opencv2.cpp +++ b/test/cfg/opencv2.cpp @@ -26,6 +26,9 @@ void validCode(char* argStr) cv::String cvStr("Hello"); cvStr += " World"; std::cout << cvStr; + + char * pBuf = (char *)cv::fastMalloc(20); + cv::fastFree(pBuf); } void ignoredReturnValue() @@ -33,3 +36,10 @@ void ignoredReturnValue() // cppcheck-suppress ignoredReturnValue cv::imread("42.png"); } + +void memleak() +{ + char * pBuf = (char *)cv::fastMalloc(1000); + std::cout << pBuf; + // cppcheck-suppress memleak +}