Fix leaks on object_property_add_str() setters
cover Fix leaks on object_property_add_str() setters
Resending two patches from the previous series which were not applied yet.
Eduardo Habkost (2):
rng-egd: Free old chr_name value before setting new one hw/machine: Free old values of string properties
backends/rng-egd.c | 1 + hw/core/machine.c | 8 ++++++++ 2 files changed, 9 insertions(+)
Signature · 1 line
1.9.3
PATCH RESEND 1/2 rng-egd: Free old chr_name value before setting new one
--- backends/rng-egd.c | 1 + 1 file changed, 1 insertion(+)
backends/rng-egd.c +1 -0
@@ -169,6 +169,7 @@ static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp)if (b->opened) {error_set (errp,QERR_PERMISSION_DENIED ); }else { +g_free (s->chr_name); s->chr_name =g_strdup (value); } }
Signature · 1 line
1.9.3
PATCH RESEND 2/2 hw/machine: Free old values of string properties
In reply to Eduardo Habkost--- hw/core/machine.c | 8 ++++++++ 1 file changed, 8 insertions(+)
hw/core/machine.c +8 -0
@@ -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); }
Signature · 1 line
1.9.3
Re: [Qemu-devel] [PATCH RESEND 1/2] rng-egd: Free old chr_name value before setting new one
In reply to Eduardo HabkostQuoted 11 lines · Eduardo Habkost
Reviewed-by Markus Armbruster <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>--- backends/rng-egd.c | 1 + 1 file changed, 1 insertion(+)backends/rng-egd.c +0
-0
backends/rng-egd.c static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp) · line 175
Quoted 7 lines
backends/rng-egd.c +1
-0@@ -169,6 +169,7 @@ static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp)if (b->opened) {error_set (errp,QERR_PERMISSION_DENIED ); }else { +g_free (s->chr_name); s->chr_name =g_strdup (value); } }
Eduardo, a similar patch had been applied.
commit 5e490b6a504912225dff0e520e1c6af68295d238
Author: Amos Kong <[email protected]> Date: Thu Nov 21 16:42:50 2013 +0800
rng-egd: remove redundant free
We didn't set default chr_name, the free is redundant.
Message-id: [email protected]
Quoted 2 lines
Signature · 1 line
1.9.3
Signature · 1 line
Amos.
Re: [Qemu-devel] [PATCH RESEND 2/2] hw/machine: Free old values of string properties
In reply to Eduardo HabkostQuoted 3 lines · Eduardo Habkost
Reviewed-by Markus Armbruster <[email protected]>Reviewed-by Marcel Apfelbaum <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>
Quoted 75 lines
--- hw/core/machine.c | 8 ++++++++ 1 file changed, 8 insertions(+)hw/core/machine.c +8
-0@@ -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); }Signature · 1 line
1.9.3
Signature · 1 line
Amos.
Re: [Qemu-devel] [PATCH RESEND 1/2] rng-egd: Free old chr_name value before setting new one
In reply to Amos KongIl 07/08/2014 04:24, Amos Kong ha scritto:
Quoted 6 lines
Eduardo, a similar patch had been applied.
commit
5e490b6a504912225dff0e520e1c6af68295d238Author: Amos Kong <[email protected]> Date: Thu Nov 21 16:42:50 2013 +0800
Quoted 8 lines
rng-egd: remove redundant free
We didn't set default
chr_name, the free is redundant.Signed-off-by Amos Kong <[email protected]>Message-id: [email protected]
Signed-off-by Anthony Liguori <[email protected]>
What if you set chr_name twice?
Paolo
Ping? Who can apply these?
Quoted 15 lines · Eduardo Habkost
Resending two patches from the previous series which were not applied yet.
Eduardo Habkost (2):
rng-egd: Free oldchr_namevalue before setting new one hw/machine: Free old values of string propertiesbackends/rng-egd.c | 1 + hw/core/machine.c | 8 ++++++++ 2 files changed, 9 insertions(+)Signature · 1 line
1.9.3
Signature · 1 line
Eduardo
Are these appropriate for 2.1.1?
Add Cc stable?
Quoted 21 lines · Eduardo Habkost
Ping? Who can apply these?
Quoted 15 lines · Eduardo Habkost
Resending two patches from the previous series which were not applied yet.
Eduardo Habkost (2):
rng-egd: Free oldchr_namevalue before setting new one hw/machine: Free old values of string propertiesbackends/rng-egd.c | 1 + hw/core/machine.c | 8 ++++++++ 2 files changed, 9 insertions(+)Signature · 1 line
1.9.3Signature · 1 line
Eduardo
Il 24/08/2014 13:16, Michael S. Tsirkin ha scritto:
Quoted 3 lines
Are these appropriate for 2.1.1?
Add Cc stable?
I think so.
Paolo
Re: [Qemu-devel] [PATCH RESEND 1/2] rng-egd: Free old chr_name value before setting new one
In reply to Paolo BonziniQuoted 9 lines · Paolo Bonzini
Il 07/08/2014 04:24, Amos Kong ha scritto:
Quoted 8 lines
Eduardo, a similar patch had been applied.
commit
5e490b6a504912225dff0e520e1c6af68295d238Author: Amos Kong <[email protected]> Date: Thu Nov 21 16:42:50 2013 +0800rng-egd: remove redundant free
Quoted 8 lines
Quoted 6 lines
We didn't set default
chr_name, the free is redundant.Signed-off-by Amos Kong <[email protected]>Message-id: [email protected]
Signed-off-by Anthony Liguori <[email protected]>What if you set
chr_nametwice?
In this case, g_free() is necessary.
So I'm fine with Eduardo's patch: [PATCH RESEND 1/2] rng-egd: Free old chr_name value
Quoted 1 line
Paolo
Signature · 1 line
Amos.
Quoted 6 lines · Paolo Bonzini
Il 24/08/2014 13:16, Michael S. Tsirkin ha scritto:
Quoted 3 lines
Are these appropriate for 2.1.1?
Add Cc stable?I think so.
I agree it can go to -stable, but just getting it applied to master is being difficult enough. :(
Repeating my question from 2 weeks ago: who can apply these?
Signature · 1 line
Eduardo
Michael S. Tsirkin
AppliedRe: [Qemu-devel] [PATCH RESEND 2/2] hw/machine: Free old values of string properties
In reply to Eduardo HabkostQuoted 3 lines · Eduardo Habkost
Reviewed-by Markus Armbruster <[email protected]>Reviewed-by Marcel Apfelbaum <[email protected]>Signed-off-by Eduardo Habkost <[email protected]>
Applied, thanks!
Quoted 75 lines
--- hw/core/machine.c | 8 ++++++++ 1 file changed, 8 insertions(+)hw/core/machine.c +8
-0@@ -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); }Signature · 1 line
1.9.3
Quoted 6 lines · Eduardo Habkost
Quoted 5 lines · Paolo Bonzini
Il 24/08/2014 13:16, Michael S. Tsirkin ha scritto:
Quoted 3 lines
Are these appropriate for 2.1.1?
Add Cc stable?
Quoted 6 lines
Quoted 1 line
I think so.
I agree it can go to -stable, but just getting it applied to master is being difficult enough. :(
Repeating my question from 2 weeks ago: who can apply these?
I applied 2/2, 1/2 is no longer needed IIUC?
Quoted 2 lines
Signature · 1 line
Eduardo
Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Eduardo Habkost
Quoted 5 lines · Paolo Bonzini
Il 24/08/2014 13:16, Michael S. Tsirkin ha scritto:
Quoted 3 lines
Are these appropriate for 2.1.1?
Add Cc stable?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
I think so.
I agree it can go to -stable, but just getting it applied to master is being difficult enough. :(
Repeating my question from 2 weeks ago: who can apply these?
I applied 2/2, 1/2 is no longer needed IIUC?
Added Cc: [email protected] as well.
Quoted 2 lines
Quoted 2 lines
Signature · 1 line
Eduardo
Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Eduardo Habkost
Quoted 5 lines · Paolo Bonzini
Il 24/08/2014 13:16, Michael S. Tsirkin ha scritto:
Quoted 3 lines
Are these appropriate for 2.1.1?
Add Cc stable?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
I think so.
I agree it can go to -stable, but just getting it applied to master is being difficult enough. :(
Repeating my question from 2 weeks ago: who can apply these?
I applied 2/2, 1/2 is no longer needed IIUC?
It is still needed. The "similar patch" Amos mentioned (commit 5e490b6a504912225dff0e520e1c6af68295d238) is actually the one that introduces the bug I am fixing (I just didn't use git-revert because I wasn't aware of that commit).
Signature · 1 line
Eduardo
Quoted 13 lines · Eduardo Habkost
Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Eduardo Habkost
Quoted 6 lines · Paolo Bonzini
Il 24/08/2014 13:16, Michael S. Tsirkin ha scritto:
Quoted 3 lines
Are these appropriate for 2.1.1?
Add Cc stable?I think so.
I agree it can go to -stable, but just getting it applied to master is being difficult enough. :(
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Repeating my question from 2 weeks ago: who can apply these?
I applied 2/2, 1/2 is no longer needed IIUC?
It is still needed. The "similar patch" Amos mentioned (commit
5e490b6a504912225dff0e520e1c6af68295d238) is actually the one that introduces the bug I am fixing (I just didn't use git-revert because I wasn't aware of that commit).
OK will apply as revert.
Quoted 2 lines
Signature · 1 line
Eduardo