From fae1b8aac47ea5009b11f5d562e1eaa0ec925c6a Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 10 Jan 2011 16:56:36 -0700 Subject: [PATCH] cpu: plug memory leak * src/cpu/cpu_x86.c (x86ModelLoad): Free data before overwriting. --- src/cpu/cpu_x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index df1e431619..ae8e5e7961 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -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; }