EEPROM memory-stomping bug?

Are you freeing that pointer, later?

Using pointers and malloc on a system with so little memory is not really a good idea. Using references is a better idea, generally. Pass a reference to the function, telling it where to store the data. The caller can than create (statically) an instance of the structure for the function to write to.