Ps3 Memory leaks... (Developing OpenBOR port for PS3)

Hi to all.
I don't understand a memory violation on PS3 port when realloc a memory.
This happens only with a mod: Knights of the Round Revenge and just on PS3 (on PC it's ok).
I use Windows and debuggin it on win version I have no exceptions.

Here the code:
void alloc_specials(s_model *newchar)
{
newchar->special = realloc(newchar->special, sizeof(*newchar->special) * (newchar->specials_loaded + 1)); // <------------ MEM VIOLATION
memset(newchar->special + newchar->specials_loaded, 0, sizeof(*newchar->special));
}

in file:
https://raw.githubusercontent.com/whitedragon0000/OpenBOR_PLUS/master/engine/openbor.c

it fails that realloc.

The strange thing is that the "special" member of newchar (s_model) has fixed memory allocated.

So... What's wrong? Thanks..
 

Similar threads

Back
Top