fixed memory leak, free on stack ptr