I allocated a memory buffer big enough to store the full path of the file.
I feel like Sherlock, if he were a developer

Wouldn’t a better solution be just

char *filename = “models/bullet.h3d”;

since all your code does is exactly that, there seems to be little reason to do it in the way given, or perhaps it’s done like this because the real code, in the real problem isn’t like this simplified example?

A single golf clap? Or a long standing ovation?

By clapping more or less, you can signal to us which stories really stand out.