diff options
Diffstat (limited to 'pjlib/include/pj/list_i.h')
-rw-r--r-- | pjlib/include/pj/list_i.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pjlib/include/pj/list_i.h b/pjlib/include/pj/list_i.h index b604d790..5701381f 100644 --- a/pjlib/include/pj/list_i.h +++ b/pjlib/include/pj/list_i.h @@ -75,6 +75,12 @@ PJ_IDEF(void) pj_list_merge_first(pj_list_type *lst1, pj_list_type *lst2) PJ_IDEF(void) pj_list_erase(pj_list_type *node) { pj_link_node( ((pj_list*)node)->prev, ((pj_list*)node)->next); + + /* It'll be safer to init the next/prev fields to itself, to + * prevent multiple erase() from corrupting the list. See + * ticket #520 for one sample bug. + */ + pj_list_init(node); } |