render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
9119d9
From e3f6d01cc56a7b706d59f6ac62678622f26559b4 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <e3f6d01cc56a7b706d59f6ac62678622f26559b4@dist-git>
898951
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
9119d9
Date: Fri, 19 Sep 2014 10:13:50 +0200
898951
Subject: [PATCH] Fix leak in x86UpdateHostModel
898951
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1144303
9119d9
898951
Commit de0aeaf introduced a memory leak.
898951
898951
(cherry picked from commit 5b5631dedf59e540661bfeac774e543d8d38531b)
9119d9
898951
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
898951
---
898951
 src/cpu/cpu_x86.c | 4 +++-
898951
 1 file changed, 3 insertions(+), 1 deletion(-)
898951
898951
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
9119d9
index affc882..0df8653 100644
898951
--- a/src/cpu/cpu_x86.c
898951
+++ b/src/cpu/cpu_x86.c
9119d9
@@ -2094,8 +2094,10 @@ x86UpdateHostModel(virCPUDefPtr guest,
898951
      * features directly */
898951
     for (i = 0; i < guest->nfeatures; i++) {
898951
         for (feat = map->migrate_blockers; feat; feat = feat->next) {
898951
-            if (STREQ(feat->name, guest->features[i].name))
898951
+            if (STREQ(feat->name, guest->features[i].name)) {
898951
+                VIR_FREE(guest->features[i].name);
898951
                 VIR_DELETE_ELEMENT_INPLACE(guest->features, i, guest->nfeatures);
898951
+            }
898951
         }
898951
     }
898951
 
898951
-- 
9119d9
2.1.1
898951