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

Discussion in 'Homebrew Development' started by White Dragon, Sep 1, 2018.

  1. 7,608
    5,759
    872
    kozarovv

    kozarovv Super Moderator

    Joined:
    Nov 8, 2014
    Messages:
    7,608
    Likes Received:
    5,759
    Trophy Points:
    872
    Home Page:
    STLcardsWS likes this.
  2. 52
    81
    42
    White Dragon

    White Dragon Developer

    Joined:
    Aug 28, 2018
    Messages:
    52
    Likes Received:
    81
    Trophy Points:
    42
    Gender:
    Male
    Occupation:
    Software Developer
    Location:
    Lecce (Italy)
    Home Page:
    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..
     

Share This Page