]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
secret: use g_new0 instead of VIR_ALLOC*
authorJán Tomko <jtomko@redhat.com>
Wed, 23 Sep 2020 20:05:04 +0000 (22:05 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 1 Oct 2020 10:34:13 +0000 (12:34 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/secret/secret_driver.c

index 1cb342878faba926b20749c12c1a69f77b1e1c8a..45da09322bfec9771efd37eb3a36ceca112a25f6 100644 (file)
@@ -459,8 +459,7 @@ secretStateInitialize(bool privileged,
                       virStateInhibitCallback callback G_GNUC_UNUSED,
                       void *opaque G_GNUC_UNUSED)
 {
-    if (VIR_ALLOC(driver) < 0)
-        return VIR_DRV_STATE_INIT_ERROR;
+    driver = g_new0(virSecretDriverState, 1);
 
     driver->lockFD = -1;
     if (virMutexInit(&driver->lock) < 0) {