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>
master
Danny Al-Gaaf 2014-04-27 18:54:21 +02:00
parent b14af86424
commit 31810e1fdc
1 changed files with 1 additions and 0 deletions

View File

@ -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;