Print this page
10124 smatch fixes for cryptoadm

*** 21,30 **** --- 21,31 ---- /* * 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,169 **** p = p->next; n++; } *pmech_list = malloc(n * sizeof (CK_MECHANISM_TYPE)); ! if (pmech_list == NULL) { cryptodebug("out of memory"); return (FAILURE); } p = mlist; for (i = 0; i < n; i++) { --- 160,170 ---- p = p->next; n++; } *pmech_list = malloc(n * sizeof (CK_MECHANISM_TYPE)); ! if (*pmech_list == NULL) { cryptodebug("out of memory"); return (FAILURE); } p = mlist; for (i = 0; i < n; i++) {