From 1337d6e1fa1644974c734cf738575c6a9755c5ef Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 6 Jun 2023 00:21:09 +0200 Subject: Fixed some use-after-frees --- inc/lib/pqueue.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'inc/lib') diff --git a/inc/lib/pqueue.h b/inc/lib/pqueue.h index 732002e..02988ce 100644 --- a/inc/lib/pqueue.h +++ b/inc/lib/pqueue.h @@ -105,13 +105,21 @@ size_t pqueue_size(struct pqueue *q); int pqueue_insert(struct pqueue *q, void *d); /** - * move an existing entry to a different priority + * move an existing entry to a different priority. * @param q the queue * @param new_pri the new priority * @param d the entry */ void pqueue_change_priority(struct pqueue *q, pqueue_pri_t new_pri, void *d); +/** + * remove an item from the queue. + * @param q the queue + * @param d the item + * @return 0 on success + */ +int pqueue_remove(struct pqueue *q, void *d); + /** * pop the highest-ranking item from the queue. * @param q the queue -- cgit v1.2.3