Revision 342
added some flags to the make computer target
checked some calls of malloc to make sure that it didn't return null
sensor_matrix.c | ||
---|---|---|
61 | 61 |
} |
62 | 62 |
m->size = DEFAULT_SENSOR_MATRIX_SIZE; |
63 | 63 |
m->matrix = (int**)malloc(m->size * sizeof(int*)); |
64 |
if (!(m->matrix)) { |
|
65 |
WL_DEBUG_PRINT("Out of memory - allocating memory for matrix.\r\n"); |
|
66 |
free(m); |
|
67 |
return NULL; |
|
68 |
} |
|
64 | 69 |
m->joined = (int*)malloc(m->size * sizeof(int)); |
70 |
if (!(m->joined)) { |
|
71 |
WL_DEBUG_PRINT("Out of memory - allocating memory for joined.\r\n"); |
|
72 |
free(m->matrix); |
|
73 |
free(m); |
|
74 |
return NULL; |
|
75 |
} |
|
65 | 76 |
m->numJoined = 0; |
66 | 77 |
if (!(m->matrix) || !(m->joined)) |
67 | 78 |
{ |
Also available in: Unified diff