mirror of
https://github.com/gnustep/libs-performance.git
synced 2025-02-15 08:00:52 +00:00
fix potential nul pointer dereference
This commit is contained in:
parent
6eb08935ea
commit
2a1ec7970c
1 changed files with 5 additions and 2 deletions
|
@ -372,7 +372,7 @@ GSLinkedListInsertAfter(GSListLink *link, GSLinkedList *list, GSListLink *at)
|
|||
{
|
||||
at = list->tail;
|
||||
}
|
||||
link->next = at->next;
|
||||
link->next = at ? at->next : nil;
|
||||
if (nil == link->next)
|
||||
{
|
||||
list->tail = link;
|
||||
|
@ -381,7 +381,10 @@ GSLinkedListInsertAfter(GSListLink *link, GSLinkedList *list, GSListLink *at)
|
|||
{
|
||||
link->next->previous = link;
|
||||
}
|
||||
at->next = link;
|
||||
if (at)
|
||||
{
|
||||
at->next = link;
|
||||
}
|
||||
link->previous = at;
|
||||
}
|
||||
link->owner = list;
|
||||
|
|
Loading…
Reference in a new issue