util: event: check return value of virInitialize

This function can possibly fail.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 2e07a1e146
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2020-09-22 23:17:18 +02:00
parent 02552c2d1e
commit a95fc75627

View File

@ -305,7 +305,8 @@ int virEventRegisterDefaultImpl(void)
{
VIR_DEBUG("registering default event implementation");
virInitialize();
if (virInitialize() < 0)
return -1;
virResetLastError();