tinyalloc icon indicating copy to clipboard operation
tinyalloc copied to clipboard

ta_alloc(0) leads to returning same non-NULL address twice

Open jlindgren90 opened this issue 3 months ago • 1 comments

Calling ta_alloc(0) and then another ta_alloc() (of any size) appears to be returning the same address twice. Having two memory blocks sharing the same address is bad since there is no way for ta_free() to know which to free.

ta_alloc(0) should probably either return NULL or behave the same as if ta_alloc(1) was called.

jlindgren90 avatar Mar 24 '24 08:03 jlindgren90

@jlindgren90 Thank you very much for this and the other PR - I will take a look asap, but likely will take a little while for me to review & test this...

postspectacular avatar Mar 27 '24 07:03 postspectacular