You are not freeing your memory because the memory was allocated on the stack by simply declaring your array. Then the memory will be freed upon exiting the method. You should free your memory, though if it was allocated on the heap using the C malloc function.
Take a look at this doc . This explains everything related to C memory management.
source share