Index: libcfa/src/stdlib.cfa
===================================================================
--- libcfa/src/stdlib.cfa	(revision cafb687b0747426341d347fa662a88c623c5c314)
+++ libcfa/src/stdlib.cfa	(revision 9421f3d8aa85bb55de754037f302d2e96c392242)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:10:29 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Oct 20 18:41:23 2019
-// Update Count     : 473
+// Last Modified On : Tue Oct 22 08:57:52 2019
+// Update Count     : 478
 //
 
@@ -21,5 +21,5 @@
 #include <string.h>										// memcpy, memset
 #include <malloc.h>										// malloc_usable_size
-#include <math.h>										// fabsf, fabs, fabsl
+//#include <math.h>										// fabsf, fabs, fabsl
 #include <complex.h>									// _Complex_I
 #include <assert.h>
@@ -41,5 +41,5 @@
 		char * nptr;
 		size_t alignment = malloc_alignment( ptr );
-		if ( align != alignment ) {
+		if ( align != alignment && (uintptr_t)ptr % align != 0 ) {
 			size_t olen = malloc_usable_size( ptr );	// current allocation
 			nptr = (char *)memalign( align, olen );
@@ -47,4 +47,5 @@
 			size_t lnth = olen < nlen ? olen : nlen;	// min
 			memcpy( nptr, ptr, lnth );					// initialize storage
+			free( ptr );
 		} else {
 			nptr = (char *)ptr;
@@ -62,4 +63,5 @@
 			size_t lnth = olen < nlen ? olen : nlen;	// min
 			memcpy( nptr, ptr, lnth );					// initialize storage
+			free( ptr );
 		} else {
 			nptr = (char *)realloc( (void *)ptr, dim * sizeof(T) ); // C realloc
