mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-20 19:52:10 +00:00
Correctly handle failure of pipe() call in swap_to_tcp()
This commit is contained in:
2 files changed
+7
-7
No files matched your search
+5
-5
@@ -2091,11 +2091,11 @@ int swap_to_tcp(struct frec *forward, time_t now, int status, struct dns_header
|
||||
if (daemon->tcp_pids[i] == 0 && daemon->tcp_pipes[i] == -1)
|
||||
break;
|
||||
|
||||
/* No slots */
|
||||
if (i < 0)
|
||||
return STAT_ABANDONED;
|
||||
|
||||
if (pipe(pipefd) == 0 && (p = fork()) != 0)
|
||||
/* No slots or no pipe */
|
||||
if (i < 0 || pipe(pipefd) != 0)
|
||||
return STAT_ABANDONED;`
|
||||
|
||||
if ((p = fork()) != 0)
|
||||
{
|
||||
close(pipefd[1]); /* parent needs read pipe end. */
|
||||
if (p == -1)
|
||||
|
||||
Reference in new issue
Block a user