Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#140 closed bug (fixed)

Deletion forgetting

Reported by: bxi07354@… Owned by: korli
Priority: normal Milestone: R1
Component: Applications Version:
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp

KeyboardInputDevice::DeviceWatcher(void *arg) 736: keymap->GetChars(keycode, dev->modifiers, activeDeadKey, &str, &numBytes); 737: keymap->GetChars(keycode, 0, 0, &str2, &numBytes2);

GetChars returns str done new char[]. However, delete[] doesn't do str.

src/add-ons/input_server/devices/keyboard/Keymap.cpp

get_key_map return map, key_buffer done malloc.

Keymap::Keymap() :

fChars(NULL)

{

key_map *keys; get_key_map(&keys, &fChars);

if (keys)

memcpy(&fKeys, keys, sizeof(key_map));

} free doesn't do keys.

status_t Keymap::LoadCurrent() {

key_map *keys = NULL; get_key_map(&keys, &fChars); if (!keys) {

fprintf(stderr, "error while getting current keymap!\n"); return B_ERROR;

} memcpy(&fKeys, keys, sizeof(fKeys)); delete keys; return B_OK;

} free doesn't do fChars. delete keys; -> free(keys);

Change History (6)

comment:1 by korli, 19 years ago

Resolution: fixed

comment:2 by korli, 19 years ago

Should be fixed in revision 16324.

comment:3 by korli, 19 years ago

Status: newclosed

comment:4 by bxi07354@…, 19 years ago

Thanks. Another one src/servers/input/InputServer.cpp

void InputServer::_InitKeyboardMouseStates()

BMessage *msg = new BMessage(B_MOUSE_MOVED); HandleSetMousePosition(msg, msg);

comment:5 by korli, 19 years ago

Fixed, thanks

comment:6 by bxi07354@…, 19 years ago

Thanks. It confirmed it.

Note: See TracTickets for help on using tickets.