michaelrsweet/mxml

Memory leak in mxml_load_data() error handling

TrondKjeldas opened this issue · 3 comments

If the mxml_load_data() function bails out at the ‘goto error’ statement at approx line 1978 it never releases the ‘node’ pointer allocated a few lines further up.

The issue can be reproduced by feeding the mxmlLoadString() function with a 0-terminated string containing only the two characters ‘<‘ and ‘\n’.

I have found a few more cases where there is memory leak.

I have a fix that fixes all these cases for me, and will try to submit a pull request.

This seems to work fine for me: #279