aboutsummaryrefslogtreecommitdiff
path: root/qapi/qapi-dealloc-visitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'qapi/qapi-dealloc-visitor.c')
-rw-r--r--qapi/qapi-dealloc-visitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index d0ea118fe3..dc53545fa5 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -131,7 +131,9 @@ 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)
{
- g_free(*obj);
+ if (obj) {
+ g_free(*obj);
+ }
}
static void qapi_dealloc_type_int(Visitor *v, int64_t *obj, const char *name,