CID 1460,1461,1462: delete[] must be used to delete arrays.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38052 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-08-12 13:23:40 +00:00
parent de6ba1a073
commit 6aaaa90f38

View File

@ -295,7 +295,7 @@ PackageItem::ParseAttribute(uint8 *buffer, BNode *node, char **attrName,
B_SWAP_BENDIAN_TO_HOST);
if (*nameSize < (length + 1)) {
delete *attrName;
delete[] *attrName;
*nameSize = length + 1;
*attrName = new char[*nameSize];
}
@ -331,7 +331,7 @@ PackageItem::ParseAttribute(uint8 *buffer, BNode *node, char **attrName,
fPackage->Seek(4, SEEK_CUR); // TODO: Check what this means
if (*tempSize < *attrCSize) {
delete *temp;
delete[] *temp;
*tempSize = *attrCSize;
*temp = new uint8[*tempSize];
}