Just avoid malloc. From MISRA/C 2004:
Rule 20.4 (required):
Dynamic heap memory allocation shall not be used.
[Unspecified 19; Undefined 91, 92; Implementation 69; Koenig 32]
This precludes the use of the functions calloc, malloc, realloc and free.
There is a whole range of unspecified, undefined and implementation-defined behaviour associated
with dynamic memory allocation, as well as a number of other potential pitfalls. Dynamic heap
memory allocation may lead to memory leaks, data inconsistency, memory exhaustion, non-
deterministic behaviour.
Note that some implementations may use dynamic heap memory allocation to implement other
functions (for example functions in the library string.h). If this is the case then these functions
shall also be avoided.
If you know that you won't need to store more than 100 integers, just declare an array with size of 128 elements (for example).