summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Ramacher <sebastian+dev@ramacher.at>2014-02-22 17:08:13 +0100
committerSebastian Ramacher <sebastian+dev@ramacher.at>2014-02-22 17:08:13 +0100
commit85c2ac670937bbe5c369e6f205213453515e37c1 (patch)
treed7ddeead03a2e93229f4badef1193f486b112301
parent694f536eb05c5dea85ad0488fedef122bb124237 (diff)
downloadpycrypto-85c2ac670937bbe5c369e6f205213453515e37c1.tar.gz
Check return value of posix_memalign
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
-rw-r--r--src/AESNI.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/AESNI.c b/src/AESNI.c
index 16119e0..b2daa81 100644
--- a/src/AESNI.c
+++ b/src/AESNI.c
@@ -52,7 +52,9 @@ static void* memalign_wrapper(size_t alignment, size_t size)
#if defined(HAVE_POSIX_MEMALIGN)
/* posix_memalign is defined by POSIX */
void* tmp = NULL;
- posix_memalign(&tmp, alignment, size);
+ int result = posix_memalign(&tmp, alignment, size);
+ if (result != 0)
+ return NULL;
return tmp;
#elif defined(HAVE_ALIGNED_ALLOC)
/* aligned_alloc is defined by C11 */