diff mbox

[1/2] qdev: accept empty string properties

Message ID 1330419255-5566-2-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Feb. 28, 2012, 8:54 a.m. UTC
These were stored as NULL due to wrong cut-and-paste from set_pointer.

Reported-by: Gerhard Wiesinger <lists@wiesinger.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/qdev-properties.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

Comments

Gerhard Wiesinger Feb. 28, 2012, 6:53 p.m. UTC | #1
Works well,

Tested-by: Gerhard Wiesinger <lists@wiesinger.com>

Ciao,
Gerhard

--
http://www.wiesinger.com/


On Tue, 28 Feb 2012, Paolo Bonzini wrote:

> These were stored as NULL due to wrong cut-and-paste from set_pointer.
>
> Reported-by: Gerhard Wiesinger <lists@wiesinger.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> hw/qdev-properties.c |    4 ----
> 1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
> index 0423af1..bff9152 100644
> --- a/hw/qdev-properties.c
> +++ b/hw/qdev-properties.c
> @@ -421,10 +421,6 @@ static void set_string(Object *obj, Visitor *v, void *opaque,
>         error_propagate(errp, local_err);
>         return;
>     }
> -    if (!*str) {
> -        g_free(str);
> -        str = NULL;
> -    }
>     if (*ptr) {
>         g_free(*ptr);
>     }
> -- 
> 1.7.7.6
>
>
>
Andreas Färber March 10, 2012, 1:14 p.m. UTC | #2
Am 28.02.2012 09:54, schrieb Paolo Bonzini:
> These were stored as NULL due to wrong cut-and-paste from set_pointer.
> 
> Reported-by: Gerhard Wiesinger <lists@wiesinger.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Andreas Färber <afaerber@suse.de>

/-F

> ---
>  hw/qdev-properties.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
> index 0423af1..bff9152 100644
> --- a/hw/qdev-properties.c
> +++ b/hw/qdev-properties.c
> @@ -421,10 +421,6 @@ static void set_string(Object *obj, Visitor *v, void *opaque,
>          error_propagate(errp, local_err);
>          return;
>      }
> -    if (!*str) {
> -        g_free(str);
> -        str = NULL;
> -    }
>      if (*ptr) {
>          g_free(*ptr);
>      }
diff mbox

Patch

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 0423af1..bff9152 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -421,10 +421,6 @@  static void set_string(Object *obj, Visitor *v, void *opaque,
         error_propagate(errp, local_err);
         return;
     }
-    if (!*str) {
-        g_free(str);
-        str = NULL;
-    }
     if (*ptr) {
         g_free(*ptr);
     }