CPP: Add a test case using 'new'.

This commit is contained in:
Geoffrey White
2019-11-19 14:30:35 +00:00
parent 57c7a87af9
commit 6fc9cc5952

View File

@@ -100,3 +100,10 @@ void good2(char *str, char *dest) {
decode(buffer, str); decode(buffer, str);
free(buffer); free(buffer);
} }
void bad9(wchar_t *wstr) {
// BAD -- using new [NOT DETECTED]
wchar_t *wbuffer = new wchar_t[wcslen(wstr)];
wcscpy(wbuffer, wstr);
delete wbuffer;
}