When processing a lot of .po files (like, over 9000) from one process
using libgettextpo, the memory leaks in the .po parsing code accumulate
to a few gigabytes, becoming a real problem in this case.
I tried to fix all the memory leaks that I could detect by running my
custom application in Valgrind. I mean, some of these leaks do not lead
to multi-gigabyte memory consumption, but they still should be fixed.
These patches are now two years old. I have already submitted them
to the "bug-gettext" mailing list, but nobody have reviewed them
since then.
Alexander Potashev (6):
Copy string from shared buffer
Fix memory leak: do not duplicate msgid_plural in message_alloc
Fix memory leak: free msgctxt in message_free
Fix memory leak: po_callback_comment_dispatcher does not take
ownership of the string passed into it
Fix memory leak: string_list_append duplicates the string
Fix memory leak: free gram_pos.file_name in lex_end()
gettext-tools/src/message.c | 7 +++++--
gettext-tools/src/msgmerge.c | 3 ++-
gettext-tools/src/po-gram-gen.y | 9 +++++----
gettext-tools/src/po-lex.c | 3 ++-
gettext-tools/src/read-mo.c | 4 ++--
gettext-tools/src/str-list.c | 11 +++++++++--
gettext-tools/src/str-list.h | 2 ++
7 files changed, 27 insertions(+), 12 deletions(-)
--
1.8.1.5