]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge memalign fix from trunk to stable branch.
authorTom Hughes <tom@compton.nu>
Thu, 6 Oct 2005 12:05:06 +0000 (12:05 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 6 Oct 2005 12:05:06 +0000 (12:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_0_BRANCH@4880

coregrind/m_mallocfree.c

index 0df8af917cec61d35622d6a3203ee6b2620e9185..864a405e66573570de511a55f59dfd1469f2715f 100644 (file)
@@ -1151,6 +1151,10 @@ void* VG_(arena_memalign) ( ArenaId aid, SizeT req_alignB, SizeT req_pszB )
    base_p = VG_(arena_malloc) ( aid, base_pszB_req );
    a->bytes_on_loan = saved_bytes_on_loan;
 
+   /* Give up if we couldn't allocate enough space */
+   if (base_p == 0)
+      return 0;
+
    /* Block ptr for the block we are going to split. */
    base_b = get_payload_block ( a, base_p );