diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2014-04-27 18:54:21 +0200 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2014-04-27 18:56:52 +0200 |
commit | 31810e1fdcd60e31029cf6be71e940e350442450 (patch) | |
tree | d61fd2da6452de2d4ece43645cdc6add83266b65 | |
parent | b14af86424e3cb8c89c0f2fd2b856580e446fba4 (diff) | |
download | jerasure-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.c | 1 |
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; |