Clears and frees secrets determined by func.
func
the Setting
function to be called to determine whether a specific secret should be cleared or not
caller-supplied data passed to func