removing a goto loop
fixing a crash caused by the correction: setting correct=NULL after freeing so the later if(correct) check properly fails