From 434daaff9aaa2b0eeb24202d61b7762d6f9d2565 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Mon, 21 Dec 2009 19:12:45 +0100 Subject: [PATCH] cpu: Fix memory leaks in x86FeatureLoad and x86ModelLoad Also backup and restore the original ctxt->node value in x86FeatureLoad. --- src/cpu/cpu_x86.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index af0a65ba40..7c50261f82 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -274,6 +274,7 @@ x86FeatureLoad(xmlXPathContextPtr ctxt, { struct x86_map *map = data; xmlNodePtr *nodes = NULL; + xmlNodePtr ctxt_node = ctxt->node; struct x86_feature *feature = NULL; int ret = 0; int i; @@ -340,6 +341,9 @@ x86FeatureLoad(xmlXPathContextPtr ctxt, } out: + ctxt->node = ctxt_node; + VIR_FREE(nodes); + return ret; no_memory: @@ -664,6 +668,7 @@ x86ModelLoad(xmlXPathContextPtr ctxt, } out: + VIR_FREE(nodes); return ret; no_memory: -- GitLab