Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision 013a5d79953470b10d851495a8b1a4246a71a5a4)
+++ uspace/lib/c/generic/malloc.c	(revision 0dd8c291a013f3ce092e304e4f3bc4dfc5129cc3)
@@ -397,4 +397,6 @@
 		assert(first_head->area == area);
 		
+		size_t shrink_size = ALIGN_DOWN(last_head->size, PAGE_SIZE);
+		
 		if (first_head == last_head) {
 			/*
@@ -420,5 +422,5 @@
 			
 			as_area_destroy(area->start);
-		} else if (last_head->size >= SHRINK_GRANULARITY) {
+		} else if (shrink_size >= SHRINK_GRANULARITY) {
 			/*
 			 * Make sure that we always shrink the area
@@ -427,5 +429,4 @@
 			 */
 			
-			size_t shrink_size = ALIGN_DOWN(last_head->size, PAGE_SIZE);
 			size_t asize = (size_t) (area->end - area->start) - shrink_size;
 			void *end = (void *) ((uintptr_t) area->start + asize);
@@ -466,6 +467,4 @@
 				}
 			}
-			
-			
 		}
 	}
