# HG changeset patch # User diego # Date 1235248707 0 # Node ID 998344532d61ae943b093ef8d636a3e82967e6ec # Parent 86393a76926083d184f0c4ca28435d99d81eae5c Check return value of posix_memalign and explicitly set pointer to NULL if it fails, patch by Patrik Kullman, patrik yes nu. diff -r 86393a769260 -r 998344532d61 mem.c --- a/mem.c Sat Feb 21 16:03:30 2009 +0000 +++ b/mem.c Sat Feb 21 20:38:27 2009 +0000 @@ -63,7 +63,8 @@ ptr = (char*)ptr + diff; ((char*)ptr)[-1]= diff; #elif HAVE_POSIX_MEMALIGN - posix_memalign(&ptr,16,size); + if (posix_memalign(&ptr,16,size)) + ptr = NULL; #elif HAVE_MEMALIGN ptr = memalign(16,size); /* Why 64?