File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -637,21 +637,23 @@ class TestLeakAutoVar : public TestFixture {
637637 }
638638
639639 void memcpyWithPtr1 () { // #11542
640+ const Settings s = settingsBuilder ().library (" std.cfg" ).library (" posix.cfg" ).build ();
640641 check (" #include <string.h>\n "
641642 " void f(char** old, char* value) {\n "
642643 " char *str = strdup(value);\n "
643644 " memcpy(old, &str, sizeof(char*));\n "
644- " }\n " );
645+ " }\n " , &s );
645646 ASSERT_EQUALS (" " , errout_str ());
646647 }
647648
648649 void memcpyWithPtr2 () {
650+ const Settings s = settingsBuilder ().library (" std.cfg" ).library (" posix.cfg" ).build ();
649651 check (" #include <string.h>\n "
650652 " void f(char* value) {\n "
651653 " char *old = NULL;\n "
652654 " char *str = strdup(value);\n "
653655 " memcpy(&old, &str, sizeof(char*));\n "
654- " }\n " );
656+ " }\n " , &s );
655657 // TODO: make this fail
656658 ASSERT_EQUALS (" " , errout_str ());
657659 }
You can’t perform that action at this time.
0 commit comments