Fix free() bug in charmap code
diff --git a/android/charmap.c b/android/charmap.c
index a313312..08c0901 100644
--- a/android/charmap.c
+++ b/android/charmap.c
@@ -721,6 +721,15 @@
void
android_charmap_done(void) {
if (NULL != android_charmaps) {
+ int n;
+ for (n = 0; n < android_charmap_count; n++) {
+ // Entries for qwerty and qwerty2 character maps are
+ // static entries defined in charmap.c
+ if ((_qwerty_charmap.entries != android_charmaps[n]->entries) &&
+ (_qwerty2_charmap.entries != android_charmaps[n]->entries)) {
+ qemu_free((void*)android_charmaps[n]->entries);
+ }
+ }
qemu_free(android_charmaps);
}
}