You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -647,20 +686,6 @@ class TestLeakAutoVar : public TestFixture {
647
686
ASSERT_EQUALS("[test.c:3]: (error) Dereferencing 'p' after it is deallocated / released\n", errout.str());
648
687
}
649
688
650
-
voiddeallocuse2() {
651
-
check("void f(char *p) {\n"
652
-
" free(p);\n"
653
-
" strcpy(a, p);\n"
654
-
"}");
655
-
TODO_ASSERT_EQUALS("error (free,use)", "[test.c:3]: (information) --check-library: Function strcpy() should have <noreturn> configuration\n", errout.str());
656
-
657
-
check("void f(char *p) {\n"// #3041 - assigning pointer when it's used
658
-
" free(p);\n"
659
-
" strcpy(a, p=b());\n"
660
-
"}");
661
-
TODO_ASSERT_EQUALS("", "[test.c:3]: (information) --check-library: Function strcpy() should have <noreturn> configuration\n", errout.str());
662
-
}
663
-
664
689
voiddeallocuse3() {
665
690
check("void f(struct str *p) {\n"
666
691
" free(p);\n"
@@ -1437,8 +1462,7 @@ class TestLeakAutoVar : public TestFixture {
1437
1462
" char *p = malloc(10);\n"
1438
1463
" fatal_error();\n"
1439
1464
"}");
1440
-
ASSERT_EQUALS("[test.c:3]: (information) --check-library: Function fatal_error() should have <noreturn> configuration\n"
1441
-
"[test.c:4]: (information) --check-library: Function fatal_error() should have <use>/<leak-ignore> configuration\n",
1465
+
ASSERT_EQUALS("[test.c:3]: (information) --check-library: Function fatal_error() should have <noreturn> configuration\n",
1442
1466
errout.str());
1443
1467
}
1444
1468
@@ -2711,6 +2735,7 @@ class TestLeakAutoVarStrcpy : public TestFixture {
2711
2735
LOAD_LIB_2(settings.library, "std.cfg");
2712
2736
2713
2737
TEST_CASE(returnedValue); // #9298
2738
+
TEST_CASE(deallocuse2);
2714
2739
TEST_CASE(fclose_false_positive); // #9575
2715
2740
}
2716
2741
@@ -2724,6 +2749,20 @@ class TestLeakAutoVarStrcpy : public TestFixture {
0 commit comments