You don't seem to have the malloc or the passing array part of the logic, just right. Post enough of the code that we can get an example that is meaningful to correct for you.
Those errors have to be studied - post them up with your expanded example. Minimum to show is the array declaration, and the function call, and the function that is being called.
The above snippets aren't enough info (for me at least).