From: dtucker Date: Thu, 30 Mar 2023 00:49:37 +0000 (+0000) Subject: Remove dead code from inside if block. The only way the if statement can X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=444feb1e2cc3c8be83858fae4f5cd2c55a6ac36e;p=openbsd Remove dead code from inside if block. 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@ --- diff --git a/usr.bin/ssh/monitor_wrap.c b/usr.bin/ssh/monitor_wrap.c index 5f5a72001ae..4dca66bf641 100644 --- a/usr.bin/ssh/monitor_wrap.c +++ b/usr.bin/ssh/monitor_wrap.c @@ -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 * Copyright 2002 Markus Friedl @@ -554,8 +554,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);