PATCH 21.5
Coverity Scan reports that gnuserv is leaking file descriptors. While
fixing that, I noticed that handle_unix_request() calls echo_request()
even when accept() returns -1, which isn't right. This patch fixes
both problems.
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:07:44 2014 -0700
@@ -1,3 +1,8 @@
+2014-12-05 Jerry James <james(a)xemacs.org>
+
+ * gnuserv.c (echo_request): close the socket when done
+ (handle_unix_request): do not call echo_request on accept failure
+
2014-10-18 Aidan Kehoe <kehoea(a)parhasard.net>
* ootags.c (substitute):
diff -r b8316d3409cd lib-src/gnuserv.c
--- a/lib-src/gnuserv.c Fri Nov 28 00:18:03 2014 +0000
+++ b/lib-src/gnuserv.c Fri Dec 05 16:07:44 2014 -0700
@@ -321,6 +321,7 @@
exit(1);
} /* if */
+ close(s);
} /* echo_request */
@@ -858,6 +859,7 @@
{
perror(progname);
fprintf(stderr,"%s: unable to accept\n",progname);
+ return;
} /* if */
echo_request(s);
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches