Fixed incorrect memory allocation issue with struct sockaddr