projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d6b89e7
)
Use xmalloc/xcalloc
author
H. Peter Anvin
<hpa@smyrno.hos.anvin.org>
Fri, 30 Sep 2005 17:47:50 +0000
(10:47 -0700)
committer
H. Peter Anvin
<hpa@smyrno.hos.anvin.org>
Fri, 30 Sep 2005 17:47:50 +0000
(10:47 -0700)
daemon.c
patch
|
blob
|
history
diff --git
a/daemon.c
b/daemon.c
index b6006c78291d1376a057f5a41f5f07b0f6b24111..6298f53fcf7f459acbb56faa50c71c104a9c5be9 100644
(file)
--- a/
daemon.c
+++ b/
daemon.c
@@
-463,9
+463,7
@@
static int socksetup(int port, int **socklist_p)
return 0;
}
- *socklist_p = malloc(sizeof(int));
- if ( !*socklist_p )
- die("memory allocation failed: %s", strerror(errno));
+ *socklist_p = xmalloc(sizeof(int));
**socklist_p = sockfd;
}
@@
-476,9
+474,7
@@
static int service_loop(int socknum, int *socklist)
struct pollfd *pfd;
int i;
- pfd = calloc(socknum, sizeof(struct pollfd));
- if (!pfd)
- die("memory allocation failed: %s", strerror(errno));
+ pfd = xcalloc(socknum, sizeof(struct pollfd));
for (i = 0; i < socknum; i++) {
pfd[i].fd = socklist[i];