CID 898 : Memory leak.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38049 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-08-12 12:42:58 +00:00
parent e0bc2fcce4
commit db8d0b8781

View File

@ -2162,13 +2162,16 @@ BDiscreteParameter::Unflatten(type_code code, const void* buffer, ssize_t size)
buffer)) < B_OK)
return B_BAD_DATA;
if (size_left(size, bufferStart, buffer) < (int)sizeof(int32))
if (size_left(size, bufferStart, buffer) < (int)sizeof(int32)) {
free(name);
return B_BAD_DATA;
}
int32 value = read_from_buffer_swap32<int32>(&buffer,
SwapOnUnflatten());
AddItem(value, name);
free(name);
}
return B_OK;