c
1 static __always_inline void maybe_wipe_obj_freeptr(struct kmem_cache *s,
2                                                    void *obj)
3 {
4     if (unlikely(slab_want_init_on_free(s)) && obj) {
5         if (is_obj_allocated(obj)) { // Add a function to check allocation status
6             memset((void *)((char *)kasan_reset_tag(obj) + s->offset),
7                    0, sizeof(void *));
8         }
9     }
10 }
