diff mbox

[12/13] qapi: Clean up superfluous null check in qapi_dealloc_type_str()

Message ID 1392042045-31525-13-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Feb. 10, 2014, 2:20 p.m. UTC
Argument can't be null.  No other Visitor method type_str() checks for
null.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/qapi-dealloc-visitor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Eric Blake Feb. 10, 2014, 3:27 p.m. UTC | #1
On 02/10/2014 07:20 AM, Markus Armbruster wrote:
> Argument can't be null.  No other Visitor method type_str() checks for
> null.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  qapi/qapi-dealloc-visitor.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
> index dc53545..d0ea118 100644
> --- a/qapi/qapi-dealloc-visitor.c
> +++ b/qapi/qapi-dealloc-visitor.c
> @@ -131,9 +131,7 @@ static void qapi_dealloc_end_list(Visitor *v, Error **errp)
>  static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
>                                    Error **errp)
>  {
> -    if (obj) {
> -        g_free(*obj);
> -    }
> +    g_free(*obj);
>  }
>  
>  static void qapi_dealloc_type_int(Visitor *v, int64_t *obj, const char *name,
>
diff mbox

Patch

diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index dc53545..d0ea118 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -131,9 +131,7 @@  static void qapi_dealloc_end_list(Visitor *v, Error **errp)
 static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
                                   Error **errp)
 {
-    if (obj) {
-        g_free(*obj);
-    }
+    g_free(*obj);
 }
 
 static void qapi_dealloc_type_int(Visitor *v, int64_t *obj, const char *name,