Reading a file and storing all the data in a buffer
I recommend to pass a file pointer rather than a path. This will enable the code to work with streams as well. It would also simplify the awkward error handling.
Modern c allows, and recommends, to declare variables closer to their use.
It is OK to realloc even when data is NULL.
sizeof(char) is guaranteed to be 1.
Incrementing data_size after memcpy lets you drop data_cursor and cursor_pos, which IMHO obfuscate the code. You'd need to

    memcpy(data + data_size, buffer, n);
    data_size += n;

Allocating an array on the stack is usually not recommended. Consider reading directly into data + data_size, and get away without buffer and memcpy.