]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu: plug memory leak
authorEric Blake <eblake@redhat.com>
Mon, 10 Jan 2011 23:56:36 +0000 (16:56 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 10 Jan 2011 23:57:54 +0000 (16:57 -0700)
* src/cpu/cpu_x86.c (x86ModelLoad): Free data before overwriting.

src/cpu/cpu_x86.c

index df1e431619af0812355c1e016c1c16b632bed02f..ae8e5e796175a98fcf9eb3b24912e5b393748aa4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * cpu_x86.c: CPU driver for CPUs with x86 compatible CPUID instruction
  *
- * Copyright (C) 2009-2010 Red Hat, Inc.
+ * Copyright (C) 2009-2011 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -973,6 +973,7 @@ x86ModelLoad(xmlXPathContextPtr ctxt,
         VIR_FREE(name);
 
         model->vendor = ancestor->vendor;
+        x86DataFree(model->data);
         if (!(model->data = x86DataCopy(ancestor->data)))
             goto no_memory;
     }