mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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 <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
7677f05d84
commit
34d5e948e8
1 changed files with 2 additions and 1 deletions
3
exec.c
3
exec.c
|
@ -3281,6 +3281,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)
|
||||
|
@ -3290,7 +3291,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue