Skip to content

Commit ff65707

Browse files
sayoojkkarunnashif
authored andcommitted
include: zephyr: sys: Assert in min_heap_get_element
Assert in `min_heap_get_element()` if heap is NULL Signed-off-by: Sayooj K Karun <[email protected]>
1 parent e719ba2 commit ff65707

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/zephyr/sys/min_heap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ void *min_heap_find(struct min_heap *heap, min_heap_eq_t eq,
212212
static inline void *min_heap_get_element(const struct min_heap *heap,
213213
size_t index)
214214
{
215+
__ASSERT_NO_MSG(heap != NULL);
216+
215217
return (void *)((uintptr_t)heap->storage + index * heap->elem_size);
216218
}
217219

0 commit comments

Comments
 (0)