Go Down

Topic: EEPROM memory-stomping bug? (Read 2 times) previous topic - next topic

PaulS

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.

IanJSeattle

Yes, religiously free()ing. ;)  Good point about passing static vars by reference, I'll look into refactoring in that direction (it would work just as well as what I'm doing with malloc()).

Go Up