Fix leak of region list in hts_itr_multi_bam() - #2084
Open
daviesrob wants to merge 1 commit into
Open
Conversation
If the regions include one of the special tid values HTS_IDX_NONE, HTS_IDX_START, or HTS_IDX_REST then the hts_itr_t::reg_list array is dropped and set to NULL, and hts_itr_t::n_reg is set to zero. As the pointer is set to NULL, it's necessary to call hts_reglist_free() here to clean up the structure first else the contents are no longer accessible and get leaked. Signed-off-by: Rob Davies <rmd+git@sanger.ac.uk>
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.
If the regions include one of the special tid values
HTS_IDX_NONE,HTS_IDX_START, orHTS_IDX_RESTthen thehts_itr_t::reg_listarray is dropped and set toNULL, andhts_itr_t::n_regis set to zero. As the pointer is set toNULL, it's necessary to callhts_reglist_free()here to clean up the structure first else the contents are no longer accessible and get leaked.