From ab349c191f048bb078ef7a534e271c7a5d7727b5 Mon Sep 17 00:00:00 2001
From: "Richard M. Stallman" <rms@gnu.org>
Date: Sat, 29 May 2004 16:10:27 +0000
Subject: [PATCH] (lisp_align_malloc): Check for base == 0 regardless of
 HAVE_POSIX_MEMALIGN. Clean up HAVE_POSIX_MEMALIGN handling of `err'.

---
 src/alloc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index 0a0b25bcb7d..055f5d82347 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -754,17 +754,20 @@ lisp_align_malloc (nbytes, type)
 #ifdef HAVE_POSIX_MEMALIGN
       {
 	int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES);
-	abase = err ? (base = NULL) : base;
+	if (err)
+	  base = NULL;
+	abase = base;
       }
 #else
       base = malloc (ABLOCKS_BYTES);
       abase = ALIGN (base, BLOCK_ALIGN);
+#endif
+
       if (base == 0)
 	{
 	  UNBLOCK_INPUT;
 	  memory_full ();
 	}
-#endif
 
       aligned = (base == abase);
       if (!aligned)
-- 
2.39.5