Skip to content

Commit

Permalink
Fix delete void pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasjaster committed Jun 2, 2024
1 parent 4b89bed commit 941f052
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ retT *LL<retT>::remove(uint32_t loc)
{
_head = current->next;
if(current->remove) {
delete current->data;
delete (retT*)current->data;
}
delete [] current;
if(_head == 0) {
Expand All @@ -394,7 +394,7 @@ retT *LL<retT>::remove(uint32_t loc)
current->next->prv = prev;
}
if(current->remove) {
delete current->data;
delete (retT*)current->data;
}
delete [] current;
}
Expand Down Expand Up @@ -436,4 +436,4 @@ uint32_t LL<retT>::length(void)
return count;
}

#endif /* LL_H_ */
#endif /* LL_H_ */
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LinkedList",
"version": "0.1.0",
"version": "0.1.1",
"description": "LinkedList Library",
"keywords": "LinkedList",
"repository":
Expand Down

0 comments on commit 941f052

Please sign in to comment.