Check matrix for NULL before call talloc().
CID
1093213 (#1 of 1): Resource leak (RESOURCE_LEAK)
4. leaked_storage: Variable "bitmatrix" going out of scope
leaks the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit
6d8fbc8b818c9f23a538f1586ee055b1dd7a7f2f)
int *bitmatrix;
int rowelts, rowindex, colindex, elt, i, j, l, x;
- bitmatrix = talloc(int, k*m*w*w);
if (matrix == NULL) { return NULL; }
+ bitmatrix = talloc(int, k*m*w*w);
+
rowelts = k * w;
rowindex = 0;