Skip to content

Commit 58660cc

Browse files
committed
Make slab_free resilient to NULL pointers
This will make slab_free behave the same way as the standard free function.
1 parent dfd8800 commit 58660cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libworkstream_df/alloc.h

+2
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ slab_alloc (struct wstream_df_thread* cthread, slab_cache_p slab_cache, unsigned
430430
static inline void
431431
slab_free (slab_cache_p slab_cache, void *e)
432432
{
433+
if (!e)
434+
return;
433435
slab_p elem = (slab_p) e;
434436
slab_metainfo_p metainfo = slab_metainfo(e);
435437
unsigned int idx = get_slab_index (metainfo->size);

0 commit comments

Comments
 (0)