Fix CID 1381: don't bother checking for (NULL == p); it's overkill.
posix_memalign() will either return 0 or not, indicating success. And if posix_memalign() fails, it's not always going to be due to out-of-memory -- just return ERR_IN_ERRNO. This commit was SVN r22070.
Этот коммит содержится в:
родитель
7900451e4e
Коммит
d317ce0367
@ -118,8 +118,8 @@ static int ptmalloc2_open(void)
|
||||
/* Double check for posix_memalign, too */
|
||||
if (opal_memory_ptmalloc2_memalign_invoked) {
|
||||
opal_memory_ptmalloc2_memalign_invoked = false;
|
||||
if (0 != posix_memalign(&p, sizeof(void*), 1024 * 1024) || NULL == p) {
|
||||
return OPAL_ERR_OUT_OF_RESOURCE;
|
||||
if (0 != posix_memalign(&p, sizeof(void*), 1024 * 1024)) {
|
||||
return OPAL_ERR_IN_ERRNO;
|
||||
}
|
||||
free(p);
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user