Double free in i2o_ECPublicKey

PR: 3338

(Imported from upstream's e34af3ec2b1230a8a523d383f7de505f7cbd381d)
This commit is contained in:
Adam Langley 2014-06-20 12:00:00 -07:00
parent eceb33d3af
commit cdf96e5886

View File

@ -544,8 +544,10 @@ int i2o_ECPublicKey(const EC_KEY *key, uint8_t **outp) {
if (!EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, *outp, if (!EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, *outp,
buf_len, NULL)) { buf_len, NULL)) {
OPENSSL_PUT_ERROR(EC, i2o_ECPublicKey, ERR_R_EC_LIB); OPENSSL_PUT_ERROR(EC, i2o_ECPublicKey, ERR_R_EC_LIB);
OPENSSL_free(*outp); if (new_buffer) {
*outp = NULL; OPENSSL_free(*outp);
*outp = NULL;
}
return 0; return 0;
} }