Skip to content

Linked_list destructor Memory Leak #14

Description

@Boilingtub

in the linked list destroy function it only ever destroy's half of the contained elements

FIX :

void LinkedList_destructor(struct LinkedList *linked_list) {
    for(int i = 0; i < linked_list->length; i++ ) {  
                                            ^^^ <- remove i++       
         LinkedList_remove(linked_list,0);                                                                       
    }                                                                                                           
}

remove i++

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions