diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-02-26 13:40:10 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-02-26 13:40:10 +0000 |
commit | 7d9906cf5784b21f9d2afab98129af86715d51d8 (patch) | |
tree | 1d38bfb6ebb0674052bf0164b7d957d5def05464 /usr.bin/ssh/channels.c | |
parent | fb45ee0a45364eeff0ab5dbbff8f2fd9f27266f9 (diff) |
change explicit_bzero();free() to freezero()
While freezero() returns early if the pointer is NULL the tests for
NULL in callers are left to avoid warnings about passing an
uninitialised size argument across a function boundry.
ok deraadt@ djm@
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r-- | usr.bin/ssh/channels.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index 41a18f71c62..d321a0d4126 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.395 2020/01/25 06:40:20 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.396 2020/02/26 13:40:09 jsg Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -615,14 +615,12 @@ channel_free(struct ssh *ssh, Channel *c) if (cc->abandon_cb != NULL) cc->abandon_cb(ssh, c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); - explicit_bzero(cc, sizeof(*cc)); - free(cc); + freezero(cc, sizeof(*cc)); } if (c->filter_cleanup != NULL && c->filter_ctx != NULL) c->filter_cleanup(ssh, c->self, c->filter_ctx); sc->channels[c->self] = NULL; - explicit_bzero(c, sizeof(*c)); - free(c); + freezero(c, sizeof(*c)); } void @@ -3262,8 +3260,7 @@ channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh) return 0; cc->cb(ssh, type, c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); - explicit_bzero(cc, sizeof(*cc)); - free(cc); + freezero(cc, sizeof(*cc)); return 0; } |