fix memory leak in cpu_unregister_map_client() and cpu_notify_map_clients().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[ Picked out of qemu-devel submission for exec.c, because we have a
clone-and-hack of the cpu_*map* code :-( -iwj ]
MapClient *client = (MapClient *)_client;
LIST_REMOVE(client, link);
+ qemu_free(client);
}
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);
}
}