From b471f03d51cde3976b6d52179ca2a86d8906a587 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 30 Jun 2009 15:22:14 +0100 Subject: [PATCH] cpu_unregister_map_client: fix memory leak fix memory leak in cpu_unregister_map_client() and cpu_notify_map_clients(). Signed-off-by: Isaku Yamahata [ Picked out of qemu-devel submission for exec.c, because we have a clone-and-hack of the cpu_*map* code :-( -iwj ] --- i386-dm/exec-dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i386-dm/exec-dm.c b/i386-dm/exec-dm.c index 45fc8e5af..b8af55a3f 100644 --- a/i386-dm/exec-dm.c +++ b/i386-dm/exec-dm.c @@ -776,6 +776,7 @@ void cpu_unregister_map_client(void *_client) MapClient *client = (MapClient *)_client; LIST_REMOVE(client, link); + qemu_free(client); } static void cpu_notify_map_clients(void) @@ -785,7 +786,7 @@ static void cpu_notify_map_clients(void) while (!LIST_EMPTY(&map_client_list)) { client = LIST_FIRST(&map_client_list); client->callback(client->opaque); - LIST_REMOVE(client, link); + cpu_unregister_map_client(client); } } -- 2.39.5