Print this page
9644 Double-free in crypto tests on failure
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Mike Zeller <mike.zeller@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/test/crypto-tests/tests/common/cryptotest_pkcs.c
          +++ new/usr/src/test/crypto-tests/tests/common/cryptotest_pkcs.c
↓ open down ↓ 94 lines elided ↑ open up ↑
  95   95  
  96   96  int
  97   97  get_mech_info(crypto_op_t *op)
  98   98  {
  99   99          CK_RV rv;
 100  100          rv = pkcs11_str2mech(op->mechname, &op->mech);
 101  101          if (rv != CKR_OK) {
 102  102                  cryptotest_error("get_mech_info", rv);
 103  103                  (void) fprintf(stderr, "failed to resolve mechanism name %s\n",
 104  104                      op->mechname);
 105      -                (void) cryptotest_close(op);
 106  105                  return (CTEST_NAME_RESOLVE_FAILED);
 107  106          }
 108  107          return (rv);
 109  108  }
 110  109  
 111  110  
 112  111  int
 113  112  get_hsession_by_mech(crypto_op_t *op)
 114  113  {
 115  114          CK_RV rv;
 116  115          rv = SUNW_C_GetMechSession(op->mech, &op->hsession);
 117  116          if (rv != CKR_OK) {
 118  117                  cryptotest_error("get_hsession_by_mech", rv);
 119  118                  (void) fprintf(stderr,
 120  119                      "could not find provider for mechanism %lu\n",
 121  120                      op->mech);
 122      -                (void) cryptotest_close(op);
 123  121                  return (CTEST_MECH_NO_PROVIDER);
 124  122          }
 125  123          return (rv);
 126  124  }
 127  125  
 128  126  /*
 129  127   * SIGN_* functions
 130  128   */
 131  129  int
 132  130  sign_init(crypto_op_t *op)
↓ open down ↓ 269 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX