summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'ssl')
-rw-r--r--ssl/priority_queue.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ssl/priority_queue.c b/ssl/priority_queue.c
index ab2442aeae..5393c532a7 100644
--- a/ssl/priority_queue.c
+++ b/ssl/priority_queue.c
@@ -265,8 +265,14 @@ void *ossl_pqueue_remove(OSSL_PQUEUE *pq, size_t elem)
ASSERT_USED(pq, n);
- if (n == pq->htop - 1)
+ if (n == pq->htop - 1) {
+ pq->elements[elem].posn = pq->freelist;
+ pq->freelist = elem;
+#ifndef NDEBUG
+ pq->elements[elem].used = 0;
+#endif
return pq->heap[--pq->htop].data;
+ }
if (n > 0)
pqueue_force_bottom(pq, n);
return ossl_pqueue_pop(pq);