Plugging leaky memory