Opened 13 years ago

Closed 13 years ago

Last modified 13 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:
Has a Patch: no 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 Changed 13 years ago by korli

Resolution: fixed

comment:2 Changed 13 years ago by korli

Should be fixed in revision 16324.

comment:3 Changed 13 years ago by korli

Status: newclosed

comment:4 Changed 13 years ago by bxi07354@…

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

void InputServer::_InitKeyboardMouseStates()

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

comment:5 Changed 13 years ago by korli

Fixed, thanks

comment:6 Changed 13 years ago by bxi07354@…

Thanks. It confirmed it.

Note: See TracTickets for help on using tickets.