Print this page
10124 smatch fixes for cryptoadm

@@ -21,10 +21,11 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Copyright 2010 Nexenta Systems, Inc.  All rights resrved.
+ * Copyright (c) 2018, Joyent, Inc.
  */
 
 #include <cryptoutil.h>
 #include <fcntl.h>
 #include <libintl.h>

@@ -159,11 +160,11 @@
                 p = p->next;
                 n++;
         }
 
         *pmech_list = malloc(n * sizeof (CK_MECHANISM_TYPE));
-        if (pmech_list == NULL) {
+        if (*pmech_list == NULL) {
                 cryptodebug("out of memory");
                 return (FAILURE);
         }
         p = mlist;
         for (i = 0; i < n; i++) {