[libvirt PATCH 10/38] qemusecuritymock: init_hash: `virHashNew` cannot return NULL

Tim Wiederhake twiederh at redhat.com
Thu Jul 22 07:50:02 UTC 2021


Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 tests/qemusecuritymock.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/tests/qemusecuritymock.c b/tests/qemusecuritymock.c
index 5daf27ccd7..87aadf564e 100644
--- a/tests/qemusecuritymock.c
+++ b/tests/qemusecuritymock.c
@@ -100,20 +100,9 @@ init_hash(void)
     if (xattr_paths)
         return;
 
-    if (!(xattr_paths = virHashNew(g_free))) {
-        fprintf(stderr, "Unable to create hash table for XATTR paths\n");
-        abort();
-    }
-
-    if (!(chown_paths = virHashNew(g_free))) {
-        fprintf(stderr, "Unable to create hash table for chowned paths\n");
-        abort();
-    }
-
-    if (!(selinux_paths = virHashNew(g_free))) {
-        fprintf(stderr, "Unable to create hash table for selinux labels\n");
-        abort();
-    }
+    xattr_paths = virHashNew(g_free);
+    chown_paths = virHashNew(g_free);
+    selinux_paths = virHashNew(g_free);
 }
 
 
-- 
2.31.1




More information about the libvir-list mailing list