free the allocated strings in error case. CID 864

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27515 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2008-09-15 08:01:33 +00:00
parent 59afe07d2c
commit 9179339c4a

View File

@ -745,8 +745,11 @@ KeyboardInputDevice::_DeviceWatcher(void *arg)
keymap->GetChars(keycode, 0, 0, &rawString, &rawNumBytes);
BMessage *msg = new BMessage;
if (msg == NULL)
if (msg == NULL) {
free(string);
free(rawString);
continue;
}
if (numBytes > 0)
msg->what = isKeyDown ? B_KEY_DOWN : B_KEY_UP;