]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
multi: Remove useless checks
authorFrank Lichtenheld <frank@lichtenheld.com>
Wed, 13 May 2026 09:17:05 +0000 (11:17 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 13 May 2026 11:09:32 +0000 (13:09 +0200)
If mi is NULL, the previous code lines already
segfaulted.

Identified by cppcheck.

Change-Id: If58bb807842b7b95aeffe6849e7a7344e4925762
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1667
Message-Id: <20260513091710.28378-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36899.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/multi.c

index 06e37582a5698ea9691f524117f7992a44645b7f..a957fdf1f2d92aeeace66a910e6b9c9524709f31 100644 (file)
@@ -3054,8 +3054,8 @@ multi_process_post(struct multi_context *m, struct multi_instance *mi, const uns
 
 #ifdef MULTI_DEBUG_EVENT_LOOP
         printf("POST %s[%d] to=%d lo=%d/%d w=%" PRIi64 "/%ld\n", id(mi), (int)(mi == m->pending),
-               mi ? mi->context.c2.to_tun.len : -1, mi ? mi->context.c2.to_link.len : -1,
-               (mi && mi->context.c2.fragment) ? mi->context.c2.fragment->outgoing.len : -1,
+               mi->context.c2.to_tun.len, mi->context.c2.to_link.len,
+               mi->context.c2.fragment ? mi->context.c2.fragment->outgoing.len : -1,
                (int64_t)mi->context.c2.timeval.tv_sec, (long)mi->context.c2.timeval.tv_usec);
 #endif
     }