Hope this helps That would be a spectacularly bad implementation of memory allocation functions and, in fact, the standard (referencing C11, the current standard in force) appears to disallow it (I'm activating "language lawyer" mode here):
How do I free() after malloc() when the result of malloc() is returned by the function?
By : skbr
Date : March 29 2020, 07:55 AM
this will help If you do not care a minor performance loss, use an NSMutableDictionary and store the point as an NSValue: