>>char combinearrays(const char *array1, const char *array2) {
The function needs to return a pointer to an array, not a single character.
>>return *text;
>>free (text);
line 45 -- free(text) -- is unreachable and will never get executed because of line 44.
line 44: should be return text;
-- remove the star