aboutsummaryrefslogtreecommitdiff
path: root/hw/core/machine.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2014-08-06 15:18:21 -0300
committerMichael S. Tsirkin <mst@redhat.com>2014-09-14 21:32:16 +0300
commit556068eed04b7f11187aabd89b981552d8d0c30e (patch)
treedb98213024a60617ecbaf9052a484eba72fa95dc /hw/core/machine.c
parent4c24f4004089a308c5de8ed720cf6bd1746aedd8 (diff)
hw/machine: Free old values of string properties
Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Cc: qemu-stable@nongnu.org
Diffstat (limited to 'hw/core/machine.c')
-rw-r--r--hw/core/machine.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index f0046d6de3..7f3418c5af 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -24,6 +24,7 @@ static void machine_set_accel(Object *obj, const char *value, Error **errp)
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->accel);
ms->accel = g_strdup(value);
}
@@ -79,6 +80,7 @@ static void machine_set_kernel(Object *obj, const char *value, Error **errp)
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->kernel_filename);
ms->kernel_filename = g_strdup(value);
}
@@ -93,6 +95,7 @@ static void machine_set_initrd(Object *obj, const char *value, Error **errp)
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->initrd_filename);
ms->initrd_filename = g_strdup(value);
}
@@ -107,6 +110,7 @@ static void machine_set_append(Object *obj, const char *value, Error **errp)
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->kernel_cmdline);
ms->kernel_cmdline = g_strdup(value);
}
@@ -121,6 +125,7 @@ static void machine_set_dtb(Object *obj, const char *value, Error **errp)
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->dtb);
ms->dtb = g_strdup(value);
}
@@ -135,6 +140,7 @@ static void machine_set_dumpdtb(Object *obj, const char *value, Error **errp)
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->dumpdtb);
ms->dumpdtb = g_strdup(value);
}
@@ -176,6 +182,7 @@ static void machine_set_dt_compatible(Object *obj, const char *value, Error **er
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->dt_compatible);
ms->dt_compatible = g_strdup(value);
}
@@ -232,6 +239,7 @@ static void machine_set_firmware(Object *obj, const char *value, Error **errp)
{
MachineState *ms = MACHINE(obj);
+ g_free(ms->firmware);
ms->firmware = g_strdup(value);
}