]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Remove dead code from inside if block.
authordtucker@openbsd.org <dtucker@openbsd.org>
Thu, 30 Mar 2023 00:49:37 +0000 (00:49 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 30 Mar 2023 03:09:37 +0000 (14:09 +1100)
The only way the if statement can be true is if both dup()s fail, and
in that case the tmp2 can never be set. Coverity CID 291805, ok djm@

OpenBSD-Commit-ID: c0d6089b3fb725015462040cd94e23237449f0c8

monitor_wrap.c

index 8e379a15c6b8eae0c2f4ba6aef3e6d60ef290f5c..275171168059574e16d0f7418c293f57a834a1ca 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_wrap.c,v 1.126 2023/01/06 02:47:18 djm Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.127 2023/03/30 00:49:37 dtucker Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
  * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -577,8 +577,6 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)
                error_f("cannot allocate fds for pty");
                if (tmp1 > 0)
                        close(tmp1);
-               if (tmp2 > 0)
-                       close(tmp2);
                return 0;
        }
        close(tmp1);