CID 630 : Allocation may fail.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38042 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-08-12 11:54:02 +00:00
parent 9b957f41ab
commit 889a547780
1 changed files with 6 additions and 2 deletions

View File

@ -1088,10 +1088,14 @@ IconView::ShowIconHeap(bool show)
if (data == NULL) {
// no vector icon or failed to get bitmap
// try bitmap icon
data = resources->LoadResource(B_LARGE_ICON_TYPE, "icon heap", NULL);
data = resources->LoadResource(B_LARGE_ICON_TYPE, "icon heap",
NULL);
if (data != NULL) {
fHeapIcon = Icon::AllocateBitmap(B_LARGE_ICON, B_CMAP8);
memcpy(fHeapIcon->Bits(), data, fHeapIcon->BitsLength());
if (fHeapIcon != NULL) {
memcpy(fHeapIcon->Bits(), data,
fHeapIcon->BitsLength());
}
}
}
}