[tex-live] memory leak with kpathsea_find_file() ?

Karl Berry karl at freefriends.org
Sun Jun 26 23:48:23 CEST 2016


    n = kpathsea_find_file(kpse, name, kpse_tfm_format, 1);
    ...
    trying to free 'n' with free() leads to errors

I don't understand that.  As far as I can recall, kpathsea_find_file
should always return newly-malloced memory, aside perhaps from
pathological cases, certainly not yours.

    Is this unfreed memory normal ? 

Yes, it is normal.  I never tried to make kpse 100% memory efficient.
A few lost bytes did not matter in 1986, and they matter even less now.

    or my code is not fully correct ?

Your code looks ok to me.  -k


More information about the tex-live mailing list