fix getsockopt memory leak
Add changes