On Mon, Nov 11, 2024 at 03:55:48PM +0000, Daniel P. Berrangé wrote:
> @@ -753,7 +761,7 @@ typedef union {
>  } qemu_max_align_t;
>  #endif
>  
> -static Object *object_new_with_type(Type type)
> +static Object *object_new_with_type(Type type, Error **errp)
>  {
>      Object *obj;
>      size_t size, align;
> @@ -777,7 +785,10 @@ static Object *object_new_with_type(Type type)
>          obj_free = qemu_vfree;
>      }
>  
> -    object_initialize_with_type(obj, size, type);
> +    if (!object_initialize_with_type(obj, size, type, errp)) {
> +        g_free(obj);

obj_free(obj)?

> +        return NULL;
> +    }
>      obj->free = obj_free;
>  
>      return obj;

-- 
Peter Xu


Reply via email to