Indeed, when virDomainCreate() < 0, virDispatchError() should be invoked,
but since we do not check its return value, there is no absolute guarantee
that the error message will always be set successfully.
virDispatchError() contains the following code:
virErrorPtr err = virLastErrorOb
From: Denis Rastyogin
virGetLastError() may return NULL in case of OOM. Without a check this
could lead to a NULL pointer dereference when accessing its fields.
The result of virGetLastError() is usually checked in other places, so
add the missing check here as well.
Found by Linux Verification