All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel.a@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
	Luiz Capitulino <lcapitul@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 3/3] hw/machine: Free old values of string properties
Date: Sun, 01 Jun 2014 11:25:57 +0300	[thread overview]
Message-ID: <1401611157.2875.97.camel@localhost.localdomain> (raw)
In-Reply-To: <1401480140-18653-4-git-send-email-ehabkost@redhat.com>

On Fri, 2014-05-30 at 17:02 -0300, Eduardo Habkost wrote:
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: Marcel Apfelbaum <marcel.a@redhat.com>
> Cc: Andreas Färber <afaerber@suse.de>
> ---
>  hw/core/machine.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index cbba679..df612bb 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);
I am not sure if in QMP is not caller's responsibility to free the input string.
If I think about it, I ask an object to set "my" string and it deletes it :(...
Same for the others.

Added Markus and Luiz, maybe they have an opinion on that.
Thanks,
Marcel
 
>      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);
>  }
>  

       reply	other threads:[~2014-06-01  8:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1401480140-18653-1-git-send-email-ehabkost@redhat.com>
     [not found] ` <1401480140-18653-4-git-send-email-ehabkost@redhat.com>
2014-06-01  8:25   ` Marcel Apfelbaum [this message]
2014-06-02 11:51     ` [Qemu-devel] [PATCH 3/3] hw/machine: Free old values of string properties Markus Armbruster
2014-06-02 12:13       ` Marcel Apfelbaum
2014-06-02 12:52         ` Markus Armbruster
2014-06-02 14:33           ` Marcel Apfelbaum
     [not found] ` <1401480140-18653-2-git-send-email-ehabkost@redhat.com>
2014-06-02 11:38   ` [Qemu-devel] [PATCH 1/3] rng-random: NULL check not needed before g_free() Markus Armbruster
2014-08-07  2:19     ` Amos Kong
2014-06-09 20:04   ` [Qemu-trivial] " Luiz Capitulino
2014-06-09 20:04     ` [Qemu-devel] " Luiz Capitulino
2014-06-21 15:06     ` [Qemu-trivial] " Michael Tokarev
2014-06-21 15:06       ` [Qemu-devel] " Michael Tokarev
     [not found] ` <1401480140-18653-3-git-send-email-ehabkost@redhat.com>
2014-06-02 12:58   ` [Qemu-devel] [PATCH 2/3] rng-egd: Free old chr_name value before setting new one Markus Armbruster
2014-06-02 14:50     ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401611157.2875.97.camel@localhost.localdomain \
    --to=marcel.a@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lcapitul@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.