We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6b89e7 commit 1b4713fCopy full SHA for 1b4713f
daemon.c
@@ -463,9 +463,7 @@ static int socksetup(int port, int **socklist_p)
463
return 0;
464
}
465
466
- *socklist_p = malloc(sizeof(int));
467
- if ( !*socklist_p )
468
- die("memory allocation failed: %s", strerror(errno));
+ *socklist_p = xmalloc(sizeof(int));
469
**socklist_p = sockfd;
470
471
@@ -476,9 +474,7 @@ static int service_loop(int socknum, int *socklist)
476
474
struct pollfd *pfd;
477
475
int i;
478
479
- pfd = calloc(socknum, sizeof(struct pollfd));
480
- if (!pfd)
481
+ pfd = xcalloc(socknum, sizeof(struct pollfd));
482
483
for (i = 0; i < socknum; i++) {
484
pfd[i].fd = socklist[i];
0 commit comments