diff -Naur wmpop3lb2.4.2/wmpop3/Pop3Client.c wmpop3lb2.4.2-pathed/wmpop3/Pop3Client.c --- wmpop3lb2.4.2/wmpop3/Pop3Client.c 2002-06-27 16:04:42.000000000 +0200 +++ wmpop3lb2.4.2-pathed/wmpop3/Pop3Client.c 2005-10-28 13:14:44.000000000 +0300 @@ -67,12 +67,18 @@ pc->server.sin_family = AF_INET; pc->hp = gethostbyname(serverName); if( pc->hp == 0) + { + close(pc->s); return -1; + } memcpy( &(pc->server.sin_addr), pc->hp->h_addr, pc->hp->h_length); pc->server.sin_port = htons(port); if ( connect(pc->s, (struct sockaddr *)&(pc->server) , sizeof(pc->server)) < 0 ) + { + close(pc->s); return -1; + } pc->connected = CONNECTED; return 0; }