|
From: <sv...@va...> - 2005-10-06 12:04:33
|
Author: tom
Date: 2005-10-06 13:04:26 +0100 (Thu, 06 Oct 2005)
New Revision: 4879
Log:
Stop memalign crashing if it fails to allocate the memory. Bug 112538.
Modified:
trunk/coregrind/m_mallocfree.c
Modified: trunk/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_mallocfree.c 2005-10-06 09:15:20 UTC (rev 4878)
+++ trunk/coregrind/m_mallocfree.c 2005-10-06 12:04:26 UTC (rev 4879)
@@ -1200,6 +1200,10 @@
base_p =3D VG_(arena_malloc) ( aid, base_pszB_req );
a->bytes_on_loan =3D saved_bytes_on_loan;
=20
+ /* Give up if we couldn't allocate enough space */
+ if (base_p =3D=3D 0)
+ return 0;
+
/* Block ptr for the block we are going to split. */
base_b =3D get_payload_block ( a, base_p );
=20
|