Compare the return value from mmap() to MAP_FAILED, not NULL.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@823 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
2c148271ae
commit
ce08052f96
|
@ -60,7 +60,7 @@ oath_key_alloc(void)
|
|||
#ifdef MAP_NOCORE
|
||||
flags |= MAP_NOCORE;
|
||||
#endif
|
||||
if ((key = mmap(NULL, sizeof *key, prot, flags, -1, 0)) != NULL) {
|
||||
if ((key = mmap(NULL, sizeof *key, prot, flags, -1, 0)) != MAP_FAILED) {
|
||||
memset(key, 0, sizeof *key);
|
||||
key->mapped = 1;
|
||||
if (mlock(key, sizeof *key) == 0)
|
||||
|
|
Loading…
Reference in New Issue