diff --git a/hmp.c b/hmp.c index ba40c7500540bfb25a1774f7b6697995384c860d..40a90dae707c244fda8e81ff781da30019237117 100644 --- a/hmp.c +++ b/hmp.c @@ -1715,4 +1715,6 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict) } monitor_printf(mon, "\n"); + + qapi_free_MemdevList(memdev_list); } diff --git a/numa.c b/numa.c index aa772aafadcc6910a81e8d681acc5c46d628d3be..f07149b12dea3ac1c036f69c8ef7dae47af13633 100644 --- a/numa.c +++ b/numa.c @@ -379,7 +379,7 @@ error: MemdevList *qmp_query_memdev(Error **errp) { Object *obj; - MemdevList *list = NULL, *m; + MemdevList *list = NULL; obj = object_resolve_path("/objects", NULL); if (obj == NULL) { @@ -393,11 +393,6 @@ MemdevList *qmp_query_memdev(Error **errp) return list; error: - while (list) { - m = list; - list = list->next; - g_free(m->value); - g_free(m); - } + qapi_free_MemdevList(list); return NULL; }