# Free'ing all buffers of a given malloc_type



## mgalgs (Jun 22, 2012)

I'm developing a kernel module that will leak memory (either by design or by accident during development). I was just curious if there was an easy way to free up *all* the buffers for a given malloc_type to "guarantee" no memory leaks.

malloc_type_list (defined in kern_malloc.c) looks promising (I would run it during MOD_UNLOAD), but I can't seem to figure out how to get the reference to the actual pointer data to pass to free. Any hints or other thoughts on the matter would be greatly appreciated.


----------

