diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-10-30 17:26:24 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-10-30 17:26:24 +0000 |
commit | 7e2e2f2eddd73060a6b3bc08de365ebb5d917574 (patch) | |
tree | 68d756c02fc7558ecbe6bbb2cace541ec7802da8 | |
parent | d77ed6ea242c4340cab52a3cbb2b619754cfa25a (diff) |
zero the correct size, then free it.
-rw-r--r-- | sys/dev/softraid_crypto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c index 5887c609b75..28960f95494 100644 --- a/sys/dev/softraid_crypto.c +++ b/sys/dev/softraid_crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_crypto.c,v 1.113 2014/10/30 17:23:45 tedu Exp $ */ +/* $OpenBSD: softraid_crypto.c,v 1.114 2014/10/30 17:26:23 tedu Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org> @@ -996,9 +996,9 @@ sr_crypto_free_resources(struct sr_discipline *sd) if (sd->mds.mdd_crypto.key_disk != NULL) { explicit_bzero(sd->mds.mdd_crypto.key_disk, - sizeof(sd->mds.mdd_crypto.key_disk)); - /* XXX correct size? XXX */ - free(sd->mds.mdd_crypto.key_disk, M_DEVBUF, 0); + sizeof(*sd->mds.mdd_crypto.key_disk)); + free(sd->mds.mdd_crypto.key_disk, M_DEVBUF, + sizeof(*sd->mds.mdd_crypto.key_disk)); } sr_hotplug_unregister(sd, sr_crypto_hotplug); |