Put a check in the destructor to ensure that we don't try to free a
NULL pointer. This commit was SVN r20569.
Этот коммит содержится в:
родитель
8f1c7cf8c2
Коммит
8b9601e35e
@ -55,7 +55,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 (NULL != 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; }
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user