brianmario / charlock_holmes

Character encoding detection, brought to you by ICU
MIT License
1.04k stars 142 forks source link

Fix one-time memory leak of encoding_list #188

Open jhawthorn opened 1 day ago

jhawthorn commented 1 day ago

We memoize this result after calculating it, and the amount of memory is tiny, so this shouldn't cause any harm. Still it's good to fix so that tools can find more serious leaks.

This was found by compiling ruby with ASAN/LSAN and running:

ASAN_OPTIONS="detect_leaks=1" RUBY_FREE_AT_EXIT=1 bundle exec rake