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:
parent
59afe07d2c
commit
9179339c4a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user