• MorphOS Developer
    jacadcaps
    Posts: 2971 from 2003/3/5
    From: Canada
    Quote:

    asrael22 wrote:
    I've replaced strdup with my own implementation that uses AllocVec as strdup probably uses malloc.
    FreeVec probably doesn't work on malloc allocated memory?



    Assuming you're on libnix (-noixemul): strdup -> malloc -> AllocPooled internally into your app's libnix pool.

    You are right that FreeVed does not work on malloc allocated memory - you've got to use free. A mixup like that will also cause a leak, if you are lucky, or a total system crash.
  • »04.04.17 - 16:01
    Profile Visit Website