summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2014-04-27 18:54:21 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2014-04-27 18:56:52 +0200
commit31810e1fdcd60e31029cf6be71e940e350442450 (patch)
treed61fd2da6452de2d4ece43645cdc6add83266b65
parentb14af86424e3cb8c89c0f2fd2b856580e446fba4 (diff)
downloadjerasure-31810e1fdcd60e31029cf6be71e940e350442450.tar.gz
jerasure.c: add check for result of malloc()
Add check for bitmatrix and return NULL if malloc failed. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/jerasure.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/jerasure.c b/src/jerasure.c
index de54fcf..a2bd3e7 100644
--- a/src/jerasure.c
+++ b/src/jerasure.c
@@ -276,6 +276,7 @@ int *jerasure_matrix_to_bitmatrix(int k, int m, int w, int *matrix)
if (matrix == NULL) { return NULL; }
bitmatrix = talloc(int, k*m*w*w);
+ if (!bitmatrix) return NULL;
rowelts = k * w;
rowindex = 0;