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 a65316abbc9e..ed1b2849900d 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 47d0ab51f02e..873642d190a9 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 989eae315a97..f4d5e17b1793 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 {