Commit 31810e1fdcd60e31029cf6be71e940e350442450

Authored by Danny Al-Gaaf
1 parent b14af864
Exists in master

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>
Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
src/jerasure.c
... ... @@ -276,6 +276,7 @@ int *jerasure_matrix_to_bitmatrix(int k, int m, int w, int *matrix)
276 276 if (matrix == NULL) { return NULL; }
277 277  
278 278 bitmatrix = talloc(int, k*m*w*w);
  279 + if (!bitmatrix) return NULL;
279 280  
280 281 rowelts = k * w;
281 282 rowindex = 0;
... ...