* CID 8120: The size supplied to the attach call was the one of the pointer, so

the data was never correctly attached.
* CID 5886 and 5887: escapements and offsets were not freed in the error case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39930 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2010-12-24 01:13:28 +00:00
parent e910a0a3b7
commit 3b1679f9c5

View File

@ -1868,9 +1868,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
fLink.Flush();
for (int32 i = 0; i < numStrings; i++) {
for (int32 i = 0; i < numStrings; i++)
free(stringArray[i]);
}
break;
}
@ -2239,13 +2238,12 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
}
} else
fLink.StartMessage(status);
delete[] escapements;
delete[] offsets;
} else
fLink.StartMessage(status);
delete[] charArray;
delete[] escapements;
delete[] offsets;
fLink.Flush();
break;
}
@ -2406,8 +2404,11 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
if (font.GetBoundingBoxes(charArray, numBytes,
rectArray, stringEscapement, mode, delta,
code == AS_GET_BOUNDINGBOXES_STRING) == B_OK) {
fLink.StartMessage(B_OK);
fLink.Attach(rectArray, sizeof(rectArray));
for (int32 i = 0; i < numChars; i++)
fLink.Attach<BRect>(rectArray[i]);
success = true;
}
}