mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Update CppCoreGuidelines.md
Must be `int* p = new int[12]; delete[] p;`
This commit is contained in:
parent
7255e7d2f0
commit
6ea1422dd6
|
@ -10510,7 +10510,7 @@ We could carefully release the resource before the throw:
|
|||
int* p = new int[12];
|
||||
// ...
|
||||
if (i < 17) {
|
||||
delete p;
|
||||
delete[] p;
|
||||
throw Bad {"in f()", i};
|
||||
}
|
||||
// ...
|
||||
|
|
Loading…
Reference in New Issue
Block a user