diff --git a/qemu/qom/object.c b/qemu/qom/object.c index da3dfcca..c2ce5213 100644 --- a/qemu/qom/object.c +++ b/qemu/qom/object.c @@ -1359,12 +1359,16 @@ static void property_get_str(struct uc_struct *uc, Object *obj, Visitor *v, void { StringProperty *prop = opaque; char *value; + Error *err = NULL; - value = prop->get(uc, obj, errp); - if (value) { - visit_type_str(v, &value, name, errp); - g_free(value); + value = prop->get(uc, obj, &err); + if (err) { + error_propagate(errp, err); + return; } + + visit_type_str(v, &value, name, errp); + g_free(value); } static int property_set_str(struct uc_struct *uc, Object *obj, Visitor *v, void *opaque,