From 932b43be04fdef9bf1fcd4250cdfc46a68fd06c7 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 6 Oct 2009 17:44:14 +0000 Subject: [PATCH] Check to ensure that the mmap succeeded. Thanks to Julia Seward for pointing out the problem and suggesting the fix. This commit was SVN r22055. --- opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c index 35ec8525d0..8214c20bd8 100644 --- a/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c +++ b/opal/mca/memory/ptmalloc2/opal_ptmalloc2_component.c @@ -134,6 +134,9 @@ static int ptmalloc2_open(void) } p = mmap(NULL, 4096, PROT_READ, MAP_ANONYMOUS, -1, 0); + if (NULL == p) { + return OPAL_ERR_OUT_OF_RESOURCE; + } munmap(p, 4096); if (opal_memory_ptmalloc2_munmap_invoked) {