From: Peter Krempa Date: Tue, 23 Feb 2021 16:15:08 +0000 (+0100) Subject: util: iohelper: Don't handle OOM from posix_memalign X-Git-Tag: v7.2.0-rc1~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dda78f0b624c1d26e61883dc4132df803abe76fb;p=thirdparty%2Flibvirt.git util: iohelper: Don't handle OOM from posix_memalign Similarly to other allocation calls abort() on failure. Signed-off-by: Peter Krempa Reviewed-by: Laine Stump --- diff --git a/src/util/iohelper.c b/src/util/iohelper.c index 49d939d290..b8810d16d3 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -27,6 +27,7 @@ #include #include +#include #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);