Skip to content
Snippets Groups Projects
Commit d9a99af5 authored by Tilghman Lesher's avatar Tilghman Lesher
Browse files

Bug 5965 - major bug in AST_LIST_REMOVE

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 8ef327b3
Branches
Tags
No related merge requests found
...@@ -424,15 +424,16 @@ struct { \ ...@@ -424,15 +424,16 @@ struct { \
#define AST_LIST_REMOVE(head, elm, field) do { \ #define AST_LIST_REMOVE(head, elm, field) do { \
if ((head)->first == (elm)) { \ if ((head)->first == (elm)) { \
(head)->first = (elm)->field.next; \ (head)->first = (elm)->field.next; \
} \ if ((head)->last = (elm)) \
else { \ (head)->last = NULL; \
} else { \
typeof(elm) curelm = (head)->first; \ typeof(elm) curelm = (head)->first; \
while (curelm->field.next != (elm)) \ while (curelm->field.next != (elm)) \
curelm = curelm->field.next; \ curelm = curelm->field.next; \
curelm->field.next = (elm)->field.next; \ curelm->field.next = (elm)->field.next; \
if ((head)->last == curelm->field.next) \
(head)->last = curelm; \
} \ } \
if ((head)->last == elm) \
(head)->last = NULL; \
} while (0) } while (0)
#endif /* _ASTERISK_LINKEDLISTS_H */ #endif /* _ASTERISK_LINKEDLISTS_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment