X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fwin32sck.c;h=2795104b3443045719c582f2552e99e85e22a79b;hb=77d2a6219fa6de3a2a39a89aa5bee27878b9289e;hp=6b3d354fd11ea15018b3ecdcd8103dcecd2aad97;hpb=47660177f659a8fbe5e2bac72a2bdfad9744a453;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/win32sck.c b/win32/win32sck.c index 6b3d354..2795104 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -125,7 +125,7 @@ my_fdopen(int fd, char *mode) /* * If we get here, then fd is actually a socket. */ - Newz(1310, fp, 1, FILE); /* XXX leak, good thing this code isn't used */ + Newxz(fp, 1, FILE); /* XXX leak, good thing this code isn't used */ if(fp == NULL) { errno = ENOMEM; return NULL; @@ -413,7 +413,7 @@ open_ifs_socket(int af, int type, int protocol) WSAPROTOCOL_INFOW *proto_buffers; int protocols_available = 0; - New(1, proto_buffers, proto_buffers_len / sizeof(WSAPROTOCOL_INFOW), + Newx(proto_buffers, proto_buffers_len / sizeof(WSAPROTOCOL_INFOW), WSAPROTOCOL_INFOW); if ((protocols_available = WSCEnumProtocols(NULL, proto_buffers, @@ -426,7 +426,8 @@ open_ifs_socket(int af, int type, int protocol) if ((af != AF_UNSPEC && af != proto_buffers[i].iAddressFamily) || (type != proto_buffers[i].iSocketType) - || (protocol != 0 && protocol != proto_buffers[i].iProtocol)) + || (protocol != 0 && proto_buffers[i].iProtocol != 0 && + protocol != proto_buffers[i].iProtocol)) continue; if ((proto_buffers[i].dwServiceFlags1 & XP1_IFS_HANDLES) == 0)