Bugsplat bug #350054: in the NT implementation of SocketTransmitFile, NSPRPUB_RELEASE_3_1_BRANCH
authorwtc%netscape.com
Fri, 23 Apr 1999 19:40:04 +0000
branchNSPRPUB_RELEASE_3_1_BRANCH
changeset 579 9e5b1d6c21b017b12953a362428cde800b745a32
parent 563 0ebfbf01d77643d9abb38c916fb5d5ad7560f2a0
child 588 6c36cec8e8d0af511e1e885e174ed7d804da62d5
push idunknown
push userunknown
push dateunknown
bugs350054
Bugsplat bug #350054: in the NT implementation of SocketTransmitFile, free the PRFileDesc only if the file is successfully transmitted. (NSPRPUB_RELEASE_3_1_BRANCH)
pr/src/io/prsocket.c
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -874,18 +874,17 @@ PRIntervalTime timeout)
 		return -1;
 	}
 #if defined(WINNT)
 	rv = _PR_MD_TRANSMITFILE(
 		sd, fd,
 		headers, hlen, flags, timeout);
 	if (rv < 0) {
 		rv = -1;
-	}
-	if (flags & PR_TRANSMITFILE_CLOSE_SOCKET) {
+	} else if (flags & PR_TRANSMITFILE_CLOSE_SOCKET) {
 		/*
 		 * This should be kept the same as SocketClose, except
 		 * that _PR_MD_CLOSE_SOCKET(sd->secret->md.osfd) should
 		 * not be called because the socket will be recycled.
 		 */
 		PR_FreeFileDesc(sd);
 	}
 #else