In a handful of cases, it was decided to return a pointer to a
structure rather than the plain structure itself, due to the size.
However, in these cases the structure was never allocated, leading to
a nil pointer exception when calling the relevant `fromC` method.
Allocate structures before attempting to fill them in.
Fixes: 453713b1750 ("golang/xenlight: Add host-related functionality")
Reported-by: Tobias Fitschen <tobias.fitschen@posteo.de>
Signed-off-by: George Dunlap <george.dunlap@cloud.com>
Tested-by: Tobias Fitschen <tobias.fitschen@posteo.de>
Acked-by: Nick Rosbrook <rosbrookn@gmail.com>
err = Error(ret)
return
}
+ physinfo = &Physinfo{}
err = physinfo.fromC(&cphys)
return
cinfo = C.libxl_get_version_info(ctx.ctx)
+ info = &VersionInfo{}
err = info.fromC(cinfo)
return
return
}
+ di = &Dominfo{}
err = di.fromC(&cdi)
return