Fixed a couple of memory leaks and an incorrect index bounds check.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8635 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -375,14 +375,16 @@ const void*
|
||||
BMessageFieldImpl<T1, StoragePolicy, SizePolicy, PrintPolicy, FlattenPolicy, GetDataPolicy>::
|
||||
DataAt(int32 index, ssize_t* size) const
|
||||
{
|
||||
if (index > CountItems())
|
||||
return NULL;
|
||||
if (index < CountItems())
|
||||
{
|
||||
*size = SizePolicy::Size(fData[index]);
|
||||
const T1& ref = fData[index];
|
||||
const T1* data = &ref;
|
||||
|
||||
*size = SizePolicy::Size(fData[index]);
|
||||
const T1& ref = fData[index];
|
||||
const T1* data = &ref;
|
||||
return GetDataPolicy::GetData(data);//(const void*)data;
|
||||
}
|
||||
|
||||
return GetDataPolicy::GetData(data);//(const void*)data;
|
||||
return NULL;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
template
|
||||
|
||||
Reference in New Issue
Block a user