virHashAtomicNew: virHashNew cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-07-05 16:59:17 +02:00
parent d2a57b4d68
commit 8b04af42da

View File

@ -102,10 +102,7 @@ virHashAtomicNew(virHashDataFree dataFree)
if (!(hash = virObjectLockableNew(virHashAtomicClass))) if (!(hash = virObjectLockableNew(virHashAtomicClass)))
return NULL; return NULL;
if (!(hash->hash = virHashNew(dataFree))) { hash->hash = virHashNew(dataFree);
virObjectUnref(hash);
return NULL;
}
return hash; return hash;
} }