From 455885da6d9c9854c673d40fa15b3a1ea690fa3c Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Wed, 18 Jan 2012 10:38:34 +0100
Subject: [PATCH 40/52] keymaps: Use glib memory allocation and free functions

RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <1326883126-22053-41-git-send-email-armbru@redhat.com>
Patchwork-id: 36619
O-Subject: [RHEL-6.3 PATCH qemu-kvm 40/52] keymaps: Use glib memory allocation and free functions
Bugzilla: 758194
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Amit Shah <amit.shah@redhat.com>

Partial backport of commit 7267c094.  Just to avoid conflicts.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 keymaps.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 keymaps.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/keymaps.c b/keymaps.c
index 6685562..3cc4445 100644
--- a/keymaps.c
+++ b/keymaps.c
@@ -52,7 +52,7 @@ static void add_to_key_range(struct key_range **krp, int code) {
 	}
     }
     if (kr == NULL) {
-	kr = qemu_mallocz(sizeof(*kr));
+	kr = g_malloc0(sizeof(*kr));
         kr->start = kr->end = code;
         kr->next = *krp;
         *krp = kr;
@@ -71,13 +71,13 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table,
     filename = qemu_find_file(QEMU_FILE_TYPE_KEYMAP, language);
 
     if (!k)
-	k = qemu_mallocz(sizeof(kbd_layout_t));
+	k = g_malloc0(sizeof(kbd_layout_t));
     if (!(filename && (f = fopen(filename, "r")))) {
 	fprintf(stderr,
 		"Could not read keymap file: '%s'\n", language);
 	return NULL;
     }
-    qemu_free(filename);
+    g_free(filename);
     for(;;) {
 	if (fgets(line, 1024, f) == NULL)
             break;
-- 
1.7.7.5

