]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: iohelper: Don't handle OOM from posix_memalign
authorPeter Krempa <pkrempa@redhat.com>
Tue, 23 Feb 2021 16:15:08 +0000 (17:15 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 Mar 2021 08:50:19 +0000 (09:50 +0100)
Similarly to other allocation calls abort() on failure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/util/iohelper.c

index 49d939d290113d893fd4775d17d6657a2ce1af4d..b8810d16d33eaca03fd23db234a2530fe3b3bac4 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <unistd.h>
 #include <fcntl.h>
+#include <stdlib.h>
 
 #include "virthread.h"
 #include "virfile.h"
@@ -57,10 +58,8 @@ runIO(const char *path, int fd, int oflags)
     off_t end = 0;
 
 #if WITH_POSIX_MEMALIGN
-    if (posix_memalign(&base, alignMask + 1, buflen)) {
-        virReportOOMError();
-        goto cleanup;
-    }
+    if (posix_memalign(&base, alignMask + 1, buflen))
+        abort();
     buf = base;
 #else
     buf = g_new0(char, buflen + alignMask);