diff --git a/lib/malloca.c b/lib/malloca.c
index e75c72df84..6938cdce7a 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -69,25 +69,27 @@ mmalloca (size_t n)
              theoretical platforms where UINTPTR_MAX <= INT_MAX.  */
           uintptr_t umemplus;
           ckd_add (&umemplus, umem, sizeof (small_t) + sa_alignment_max - 1);
-          idx_t offset = (umemplus - umemplus % (2 * sa_alignment_max)
-                          + sa_alignment_max - umem);
-          void *p = mem + offset;
-          /* Here p >= mem + sizeof (small_t),
-             and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
-             hence p + n <= mem + nplus.
-             So, the memory range [p, p+n) lies in the allocated memory range
-             [mem, mem + nplus).  */
-          small_t *sp = p;
+          {
+            idx_t offset = (umemplus - umemplus % (2 * sa_alignment_max)
+                            + sa_alignment_max - umem);
+            void *p = mem + offset;
+            /* Here p >= mem + sizeof (small_t),
+               and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
+               hence p + n <= mem + nplus.
+               So, the memory range [p, p+n) lies in the allocated memory range
+               [mem, mem + nplus).  */
+            small_t *sp = p;
 # if defined __CHERI_PURE_CAPABILITY__
-          sp[-1] = umem;
-          p = (char *) cheri_bounds_set ((char *) p - sizeof (small_t),
-                                         sizeof (small_t) + n)
+            sp[-1] = umem;
+            p = (char *) cheri_bounds_set ((char *) p - sizeof (small_t),
+                                           sizeof (small_t) + n)
               + sizeof (small_t);
 # else
-          sp[-1] = offset;
+            sp[-1] = offset;
 # endif
-          /* p ≡ sa_alignment_max mod 2*sa_alignment_max.  */
-          return p;
+            /* p ≡ sa_alignment_max mod 2*sa_alignment_max.  */
+            return p;
+          }
         }
     }
   /* Out of memory.  */
