2
0
Эх сурвалжийг харах

qapi: Clean up superfluous null check in qapi_dealloc_type_str()

Argument can't be null.  No other Visitor method type_str() checks for
null.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster 11 жил өмнө
parent
commit
25a7017555

+ 1 - 3
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,
 static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
                                   Error **errp)
                                   Error **errp)
 {
 {
-    if (obj) {
-        g_free(*obj);
-    }
+    g_free(*obj);
 }
 }
 
 
 static void qapi_dealloc_type_int(Visitor *v, int64_t *obj, const char *name,
 static void qapi_dealloc_type_int(Visitor *v, int64_t *obj, const char *name,