X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=imap-send.c;h=285ad29afb4c4126010ddc2f76963b4f8f1cce70;hb=ae448e3854d8b6e7e37aa88fa3917f5dd97f3210;hp=52e2400b57118e7f9a27c85212e1c539d16add7c;hpb=d69dc373cbf58d88d19dcbc6cff37e12b17f8fd2;p=git.git diff --git a/imap-send.c b/imap-send.c index 52e2400b..285ad29a 100644 --- a/imap-send.c +++ b/imap-send.c @@ -924,6 +924,7 @@ imap_open_store( imap_server_conf_t *srvc ) struct hostent *he; struct sockaddr_in addr; int s, a[2], preauth; + pid_t pid; ctx = xcalloc( sizeof(*ctx), 1 ); @@ -941,7 +942,10 @@ imap_open_store( imap_server_conf_t *srvc ) exit( 1 ); } - if (fork() == 0) { + pid = fork(); + if (pid < 0) + _exit( 127 ); + if (!pid) { if (dup2( a[0], 0 ) == -1 || dup2( a[0], 1 ) == -1) _exit( 127 ); close( a[0] );