Skip to content

Commit

Permalink
Merge pull request #73 from ArduinoidIOT/ArduinoidIOT-patch-1
Browse files Browse the repository at this point in the history
Fix segmentation fault in erase method
  • Loading branch information
can1357 authored May 25, 2022
2 parents 8ca24f7 + dafdf74 commit 5b0caf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions VTIL-Common/util/detached_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace vtil

k->prev = nullptr;
k->next = head;
if ( head ) head->prev = k;
if ( head && head != key::invalid_value) head->prev = k;
if ( !tail ) tail = k;
head = k;
list_size++;
Expand All @@ -169,10 +169,10 @@ namespace vtil
{
std::lock_guard _g( *this );

if ( k->prev ) k->prev->next = k->next;
if ( k->prev && k->prev != key::invalid_value) k->prev->next = k->next;
else head = k->next;

if ( k->next ) k->next->prev = k->prev;
if ( k->next && k->next != key::invalid_value) k->next->prev = k->prev;
else tail = k->prev;

k->prev = key::invalid_value;
Expand Down

0 comments on commit 5b0caf5

Please sign in to comment.