Skip to content

Commit

Permalink
Fix memory clearing error
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjcroucher committed Apr 20, 2024
1 parent 9d458a5 commit 16ae012
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Newickform.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ newick_node* build_newick_tree(char * filename, FILE *vcf_file_pointer,int * snp
char ** node_names = (char **) calloc(MAX_SAMPLE_NAME_SIZE*num_stored_nodes,sizeof(char));
for (int seq_store_index = 0; seq_store_index < num_stored_nodes; ++seq_store_index)
{
node_names[seq_store_index] = NULL;
node_names[seq_store_index] = " ";
}

// iterate through depths and identify batches of analyses to be run
Expand Down
2 changes: 1 addition & 1 deletion src/branch_sequences.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void generate_branch_sequences(newick_node *node, char ** node_sequences, char *
// Store node sequence
for (int seq_store_index = 0; seq_store_index < num_stored_nodes; ++seq_store_index)
{
if (node_names[seq_store_index] == NULL) {
if (strcmp(node_names[seq_store_index]," ") == 0) {
node_names[seq_store_index] = node->taxon;
node_sequences[seq_store_index] = node_sequence;
break;
Expand Down

0 comments on commit 16ae012

Please sign in to comment.