From: djm Date: Fri, 22 Jul 2016 03:39:13 +0000 (+0000) Subject: move debug("%p", key) to before key is free'd; probable undefined X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8674efdad74fb337ed2fa0da6ec972204e8edd64;p=openbsd move debug("%p", key) to before key is free'd; probable undefined behaviour on strict compilers; reported by Jakub Jelen bz#2581 --- diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c index 38642b35294..57f731aa207 100644 --- a/usr.bin/ssh/monitor.c +++ b/usr.bin/ssh/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.160 2016/05/02 10:26:04 djm Exp $ */ +/* $OpenBSD: monitor.c,v 1.161 2016/07/22 03:39:13 djm Exp $ */ /* * Copyright 2002 Niels Provos * Copyright 2002 Markus Friedl @@ -964,6 +964,10 @@ mm_answer_keyallowed(int sock, Buffer *m) break; } } + + debug3("%s: key %p is %s", + __func__, key, allowed ? "allowed" : "not allowed"); + if (key != NULL) key_free(key); @@ -985,9 +989,6 @@ mm_answer_keyallowed(int sock, Buffer *m) free(chost); } - debug3("%s: key %p is %s", - __func__, key, allowed ? "allowed" : "not allowed"); - buffer_clear(m); buffer_put_int(m, allowed); buffer_put_int(m, forced_command != NULL);