shortcut_catcher: memory leak fixes
memory allocated in get_key_map(..) wasn't released. CID 5696, CID 5697, CID 1699, CID 1700
This commit is contained in:
parent
a5a013ca40
commit
74983a5f69
|
@ -797,6 +797,8 @@ KeyStrokeSequenceCommandActuator::_GenerateKeyCodes()
|
||||||
_SetStateBit(states, overrideKey);
|
_SetStateBit(states, overrideKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(keys);
|
||||||
|
free(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@ static const char*
|
||||||
FindSpecialKeyLabelFor(uint8 keyCode, int& last)
|
FindSpecialKeyLabelFor(uint8 keyCode, int& last)
|
||||||
{
|
{
|
||||||
while ((keyLabels[last].fKeyCode < keyCode)
|
while ((keyLabels[last].fKeyCode < keyCode)
|
||||||
&& (last < (sizeof(keyLabels)/sizeof(struct KeyLabelMap))-1))
|
&& (last < (sizeof(keyLabels) / sizeof(struct KeyLabelMap)) - 1))
|
||||||
last++;
|
last++;
|
||||||
|
|
||||||
if (keyLabels[last].fKeyCode == keyCode)
|
if (keyLabels[last].fKeyCode == keyCode)
|
||||||
|
@ -151,6 +152,8 @@ InitKeyIndices()
|
||||||
} else
|
} else
|
||||||
utfDescriptions[j * MAX_UTF8_LENGTH] = 0x00;
|
utfDescriptions[j * MAX_UTF8_LENGTH] = 0x00;
|
||||||
}
|
}
|
||||||
|
free(keys);
|
||||||
|
free(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue