mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Fix a free(NULL) in min_heap.h
Backport of 6f20492fa27f08
This commit is contained in:
parent
01ea0c5c28
commit
245893479a
@ -56,7 +56,7 @@ int min_heap_elem_greater(struct event *a, struct event *b)
|
||||
}
|
||||
|
||||
void min_heap_ctor(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; }
|
||||
void min_heap_dtor(min_heap_t* s) { free(s->p); }
|
||||
void min_heap_dtor(min_heap_t* s) { if(s->p) free(s->p); }
|
||||
void min_heap_elem_init(struct event* e) { e->min_heap_idx = -1; }
|
||||
int min_heap_empty(min_heap_t* s) { return 0u == s->n; }
|
||||
unsigned min_heap_size(min_heap_t* s) { return s->n; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user