sist2
sist2 copied to clipboard
Memory leak in antiword third-party dependency
See #241
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.