sist2 icon indicating copy to clipboard operation
sist2 copied to clipboard

Memory leak in antiword third-party dependency

Open simon987 opened this issue 2 years ago • 1 comments

See #241

simon987 avatar Jan 22 '22 16:01 simon987

antiword is kind of a mess and hasn't been updated in the last 10 years (except some monkey patches I had to add on my fork to fix many segmentation faults)

I can quickly look into the memory leaks but it's hard for me to justify sinking hours of my time for free if the app is still kind of usable to scan .doc files on a medium scale

An easy-ish way to "patch" antiword would be to change https://github.com/simon987/antiword/blob/62ae66db99e9dd88dfa31999f516f71bb8bdc8b2/src/xmalloc.c so that the malloc calls are saved into a thread-specific linked list, and free calls replaced with no-op. When closing a .doc file (regardless of if the parsing failed or not) one could free the whole list at once.

simon987 avatar Jan 22 '22 16:01 simon987