Skip to content

Commit

Permalink
Merge pull request #39 from sfiligoi/memleak_PropStack_2304
Browse files Browse the repository at this point in the history
Fix memory leak
  • Loading branch information
sfiligoi authored Apr 28, 2023
2 parents 856c23c + 83264a7 commit badf2e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/biom_subsampled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ linked_sparse_transposed::linked_sparse_transposed(sparse_data &other)

linked_sparse_transposed::~linked_sparse_transposed() {
if(obs_data_resident != NULL) {
for (uint32_t i=0; i<n_obs; i++) free(obs_data_resident[i]);
free(obs_data_resident);
obs_data_resident = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/unifrac_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ PropStack<TFloat>::PropStack(uint32_t vecsize)
template<class TFloat>
PropStack<TFloat>::~PropStack() {
// drain stack
for(unsigned int i = 0; i < prop_stack.size(); i++) {
while (!prop_stack.empty()) {
TFloat *vec = prop_stack.top();
prop_stack.pop();
free(vec);
Expand Down

0 comments on commit badf2e1

Please sign in to comment.