Allows to free RedMemSlotInfo structure Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- server/memslot.c | 10 ++++++++++ server/memslot.h | 1 + 2 files changed, 11 insertions(+) diff --git a/server/memslot.c b/server/memslot.c index 75cb75f..fdcd023 100644 --- a/server/memslot.c +++ b/server/memslot.c @@ -166,6 +166,16 @@ void memslot_info_init(RedMemSlotInfo *info, (info->mem_slot_bits + info->generation_bits)); } +void memslot_info_destroy(RedMemSlotInfo *info) +{ + uint32_t i; + + for (i = 0; i < info->num_memslots_groups; ++i) { + free(info->mem_slots[i]); + } + free(info->mem_slots); +} + void memslot_info_add_slot(RedMemSlotInfo *info, uint32_t slot_group_id, uint32_t slot_id, uint64_t addr_delta, unsigned long virt_start, unsigned long virt_end, uint32_t generation) diff --git a/server/memslot.h b/server/memslot.h index 5046d0f..71f1210 100644 --- a/server/memslot.h +++ b/server/memslot.h @@ -66,6 +66,7 @@ void memslot_info_init(RedMemSlotInfo *info, uint8_t generation_bits, uint8_t id_bits, uint8_t internal_groupslot_id); +void memslot_info_destroy(RedMemSlotInfo *info); void memslot_info_add_slot(RedMemSlotInfo *info, uint32_t slot_group_id, uint32_t slot_id, uint64_t addr_delta, unsigned long virt_start, unsigned long virt_end, uint32_t generation); -- 2.9.3 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel