Memory-safe file-reading in C
Instead of fgets, you can use fread to read directly into the file_out:

int totalRead = 0;
int size;
while( fileSize &gt; total_read &amp;&amp; (size = fread(file_out + totalRead, 1, fileSize - totalRead, file) != 0) {
    totalRead+=size;
}
if(totalRead &lt; fileSize){
    //couldn't read entire file
}
file_out[total_read] = '\0';

return file_out;


This avoids the \$O(n^2)\$ complexity of doing strncat on a growing string. 

Doing an exit from within a helper function is not recommended because the calling code cannot recover from it. Instead, return a special value that specifies something went wrong.

Also, make up your mind about the naming convention of camelCase vs. snake_case.