From bde790d91fabd888c91a74e1de09876023a816a8 Mon Sep 17 00:00:00 2001 From: ylavic Date: Sun, 8 Mar 2015 10:10:01 +0000 Subject: skiplist: When removing the last node, we have top = bottom = NULL, and must set topend = bottomend = NULL too. Also fix test from r1664471 according to r1664911. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1664958 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tables') diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index acaec16ba..2734fbad5 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -606,7 +606,8 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_ sl->height--; } if (!sl->top) { - sl->bottom = NULL; + sl->bottom = sl->bottomend = NULL; + sl->topend = NULL; } return sl->height; /* return 1; ?? */ } -- cgit v1.2.1