Localized two leaked vars and fixed comment location

Made ptr and data vars local in SEND-AND-CHECK func. Moved patch end comment to real end of patch.