aboutsummaryrefslogtreecommitdiff
path: root/tests/test-visitor-serialization.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-visitor-serialization.c')
-rw-r--r--tests/test-visitor-serialization.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c
index 85170e5c49..74d6481992 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/test-visitor-serialization.c
@@ -195,7 +195,7 @@ typedef struct TestStruct
static void visit_type_TestStruct(Visitor *v, TestStruct **obj,
const char *name, Error **errp)
{
- Error *err= NULL;
+ Error *err = NULL;
visit_start_struct(v, (void **)obj, NULL, name, sizeof(TestStruct), &err);
if (err) {
@@ -203,11 +203,19 @@ static void visit_type_TestStruct(Visitor *v, TestStruct **obj,
}
visit_type_int(v, &(*obj)->integer, "integer", &err);
+ if (err) {
+ goto out_end;
+ }
visit_type_bool(v, &(*obj)->boolean, "boolean", &err);
+ if (err) {
+ goto out_end;
+ }
visit_type_str(v, &(*obj)->string, "string", &err);
+out_end:
+ error_propagate(errp, err);
+ err = NULL;
visit_end_struct(v, &err);
-
out:
error_propagate(errp, err);
}