Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -624,14 +624,14 @@ struct sockaddr_storage *addr; socklen_t addrLen; int newSock; newSocket = [[[[self class] alloc] init] autorelease]; - addrLen = sizeof(struct sockaddr); + addrLen = sizeof(*addr); @try { - addr = [newSocket allocMemoryWithSize: sizeof(struct sockaddr)]; + addr = [newSocket allocMemoryWithSize: addrLen]; } @catch (id e) { [newSocket release]; @throw e; }