diff options
| author | John Levon <john.levon@joyent.com> | 2018-12-19 18:17:15 +0000 |
|---|---|---|
| committer | John Levon <levon@movementarian.org> | 2019-02-20 17:22:12 +0000 |
| commit | 9d1587b49e4692b8d6652e6c0b113a53b1af5313 (patch) | |
| tree | 06f7f4d7574255bc5f017503c0de8a6c3813cfa1 /usr/src/cmd | |
| parent | 0774d909988cf217e4b3c0e093f4790d5aa9c965 (diff) | |
| download | illumos-joyent-9d1587b49e4692b8d6652e6c0b113a53b1af5313.tar.gz | |
10124 smatch fixes for cryptoadm
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Gergő Doma <domag02@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/cmd')
| -rw-r--r-- | usr/src/cmd/cmd-crypto/cryptoadm/adm_kef_ioctl.c | 2 | ||||
| -rw-r--r-- | usr/src/cmd/cmd-crypto/cryptoadm/adm_uef.c | 3 | ||||
| -rw-r--r-- | usr/src/cmd/cmd-crypto/cryptoadm/cryptoadm.c | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/usr/src/cmd/cmd-crypto/cryptoadm/adm_kef_ioctl.c b/usr/src/cmd/cmd-crypto/cryptoadm/adm_kef_ioctl.c index a65316abbc..ed1b284990 100644 --- a/usr/src/cmd/cmd-crypto/cryptoadm/adm_kef_ioctl.c +++ b/usr/src/cmd/cmd-crypto/cryptoadm/adm_kef_ioctl.c @@ -23,6 +23,7 @@ */ /* * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ #include <fcntl.h> @@ -266,6 +267,7 @@ get_dev_list(crypto_get_dev_list_t **ppdevlist) if ((fd = open(ADMIN_IOCTL_DEVICE, O_RDONLY)) == -1) { cryptoerror(LOG_STDERR, gettext("failed to open %s: %s"), ADMIN_IOCTL_DEVICE, strerror(errno)); + free(pdevlist); return (FAILURE); } diff --git a/usr/src/cmd/cmd-crypto/cryptoadm/adm_uef.c b/usr/src/cmd/cmd-crypto/cryptoadm/adm_uef.c index 47d0ab51f0..873642d190 100644 --- a/usr/src/cmd/cmd-crypto/cryptoadm/adm_uef.c +++ b/usr/src/cmd/cmd-crypto/cryptoadm/adm_uef.c @@ -23,6 +23,7 @@ */ /* * Copyright 2010 Nexenta Systems, Inc. All rights resrved. + * Copyright (c) 2018, Joyent, Inc. */ #include <cryptoutil.h> @@ -161,7 +162,7 @@ convert_mechlist(CK_MECHANISM_TYPE **pmech_list, CK_ULONG *mech_count, } *pmech_list = malloc(n * sizeof (CK_MECHANISM_TYPE)); - if (pmech_list == NULL) { + if (*pmech_list == NULL) { cryptodebug("out of memory"); return (FAILURE); } diff --git a/usr/src/cmd/cmd-crypto/cryptoadm/cryptoadm.c b/usr/src/cmd/cmd-crypto/cryptoadm/cryptoadm.c index 989eae315a..f4d5e17b17 100644 --- a/usr/src/cmd/cmd-crypto/cryptoadm/cryptoadm.c +++ b/usr/src/cmd/cmd-crypto/cryptoadm/cryptoadm.c @@ -22,6 +22,9 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <fcntl.h> #include <stdio.h> @@ -1302,7 +1305,6 @@ list_simple_for_all(boolean_t verbose) "failed to retrieve the providers' " "information from file kcf.conf - %s.", _PATH_KCF_CONF); - free(psoftlist_kernel); rc = FAILURE; } else { |
