auto rc = (RenderableComponent *)malloc(sizeof(RenderableComponent));
load_sprite(rc->sprite, "whatever.png");
malloc doesn't construct objects, it just allocates raw memory. In other words, the content of your rc variable is undefined. Never ever use malloc to instanciate objects in C++.