Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 2003d1abfa0c20ee77815f0da33e2c1c > files > 19

glibc-2.5-49.el5_5.5.src.rpm

2006-11-27  Jakub Jelinek  <jakub@redhat.com>

	[BZ #3559]
	* sunrpc/svc_run.c (svc_run): Fail instead of segfaulting if
	malloc crashed.

--- libc/sunrpc/svc_run.c	2002-05-15 02:21:01.000000000 +0200
+++ libc/sunrpc/svc_run.c	2006-11-28 17:06:24.000000000 +0100
@@ -60,6 +60,12 @@ svc_run (void)
 	return;
 
       my_pollfd = malloc (sizeof (struct pollfd) * svc_max_pollfd);
+      if (my_pollfd == NULL)
+	{
+	  perror (_("svc_run: - out of memory"));
+	  return;
+	}
+
       for (i = 0; i < svc_max_pollfd; ++i)
 	{
 	  my_pollfd[i].fd = svc_pollfd[i].fd;