CID 1744 : memory leak on error

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38131 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-08-16 08:11:47 +00:00
parent 0d858bd391
commit 8e13f13e5c
@@ -471,8 +471,10 @@ RemoteMessage::ReadGradient(BGradient** _gradient)
int32 stopCount;
status_t result = Read(stopCount);
if (result != B_OK)
if (result != B_OK) {
delete gradient;
return result;
}
for (int32 i = 0; i < stopCount; i++) {
rgb_color color;