APPROVE COMMIT 21.5
I think this is one is obvious enough to fall under the obviously
correct rule. The socket_connection() function in lib-src/pop.c
closes the socket before returning on error in all but one case. This
patch fixes up the remaining case. This bug was found by Coverity
Scan.
I will commit and push this patch shortly.
diff -r b8316d3409cd lib-src/ChangeLog
--- a/lib-src/ChangeLog Fri Nov 28 00:18:03 2014 +0000
+++ b/lib-src/ChangeLog Fri Dec 05 16:18:49 2014 -0700
@@ -1,3 +1,8 @@
+2014-12-05 Jerry James <james(a)xemacs.org>
+
+ * pop.c (socket_connection): Do not leak a socket if the POP
+ server's address cannot be determined.
+
2014-10-18 Aidan Kehoe <kehoea(a)parhasard.net>
* ootags.c (substitute):
diff -r b8316d3409cd lib-src/pop.c
--- a/lib-src/pop.c Fri Nov 28 00:18:03 2014 +0000
+++ b/lib-src/pop.c Fri Dec 05 16:18:49 2014 -0700
@@ -1075,6 +1075,7 @@
try_count++;
if ((! hostent) && ((h_errno != TRY_AGAIN) || (try_count == 5)))
{
+ CLOSESOCKET (sock);
strcpy (pop_error, "Could not determine POP server's address");
return (-1);
}
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches