Open
Conversation
pobrn
commented
Jun 21, 2025
Breaking the loop before `yaml_parser_delete()` means that in some cases
the parser will not be deinitialized properly, leading to memory leaks,
trigger sanitizers. Fix that by moving the call before the break.
Direct leak of 2064384 byte(s) in 42 object(s) allocated from:
0. 0x7fabc5d20e15 in malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:67
1. 0x5595a1c718ca in yaml_malloc (/libyaml/build/test-reader+0x398ca) (BuildId: e39075df3c1f5c997cb01bed616cc6960d0d00ac)
2. 0x5595a1c735a5 in yaml_parser_initialize (/libyaml/build/test-reader+0x3b5a5) (BuildId: e39075df3c1f5c997cb01bed616cc6960d0d00ac)
3. 0x5595a1c6e984 in check_utf8_sequences (/libyaml/build/test-reader+0x36984) (BuildId: e39075df3c1f5c997cb01bed616cc6960d0d00ac)
4. 0x5595a1c71688 in main (/libyaml/build/test-reader+0x39688) (BuildId: e39075df3c1f5c997cb01bed616cc6960d0d00ac)
5. 0x7fabc52376b4 (/usr/lib/libc.so.6+0x276b4) (BuildId: 468e3585c794491a48ea75fceb9e4d6b1464fc35)
6. 0x7fabc5237768 in __libc_start_main (/usr/lib/libc.so.6+0x27768) (BuildId: 468e3585c794491a48ea75fceb9e4d6b1464fc35)
7. 0x5595a1c6e314 in _start (/libyaml/build/test-reader+0x36314) (BuildId: e39075df3c1f5c997cb01bed616cc6960d0d00ac)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.