}
} else tmpval = NULL;
mhdr = (MIME_HEADER *) malloc(sizeof(MIME_HEADER));
- if (!mhdr)
+ if (!mhdr) {
+ OPENSSL_free(tmpname);
return NULL;
+ }
mhdr->name = tmpname;
mhdr->value = tmpval;
if (!(mhdr->params = sk_MIME_PARAM_new(mime_param_cmp))) {
ctx = malloc(sizeof(BIO_ASN1_BUF_CTX));
if (!ctx)
return 0;
- if (!asn1_bio_init(ctx, DEFAULT_ASN1_BUF_SIZE))
+ if (!asn1_bio_init(ctx, DEFAULT_ASN1_BUF_SIZE)) {
+ free(ctx);
return 0;
+ }
b->init = 1;
b->ptr = (char *)ctx;
b->flags = 0;
* sizeof(*derlst));
tmpdat = malloc(skcontlen);
if (!derlst || !tmpdat)
+ free(derlst);
+ free(tmpdat);
return 0;
}
}
rctx->iobuflen = OCSP_MAX_LINE_LEN;
rctx->iobuf = malloc(rctx->iobuflen);
if (!rctx->iobuf) {
+ BIO_free(rctx->mem);
free(rctx);
return 0;
}
if (BIO_printf(rctx->mem, post_hdr, path) <= 0) {
free(rctx->iobuf);
+ BIO_free(rctx->mem);
free(rctx);
return 0;
}
if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) {
free(rctx->iobuf);
+ BIO_free(rctx->mem);
free(rctx);
return 0;
}
ret->verify_cb=0;
if ((ret->param = X509_VERIFY_PARAM_new()) == NULL) {
+ sk_X509_OBJECT_free(ret->objs);
free(ret);
return NULL;
}
b64_str = malloc(der_len * 2);
if(!der_spki || !b64_str) {
X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
+ free(der_spki);
+ free(b64_str);
return NULL;
}
p = der_spki;
}
} else tmpval = NULL;
mhdr = (MIME_HEADER *) malloc(sizeof(MIME_HEADER));
- if (!mhdr)
+ if (!mhdr) {
+ OPENSSL_free(tmpname);
return NULL;
+ }
mhdr->name = tmpname;
mhdr->value = tmpval;
if (!(mhdr->params = sk_MIME_PARAM_new(mime_param_cmp))) {
ctx = malloc(sizeof(BIO_ASN1_BUF_CTX));
if (!ctx)
return 0;
- if (!asn1_bio_init(ctx, DEFAULT_ASN1_BUF_SIZE))
+ if (!asn1_bio_init(ctx, DEFAULT_ASN1_BUF_SIZE)) {
+ free(ctx);
return 0;
+ }
b->init = 1;
b->ptr = (char *)ctx;
b->flags = 0;
* sizeof(*derlst));
tmpdat = malloc(skcontlen);
if (!derlst || !tmpdat)
+ free(derlst);
+ free(tmpdat);
return 0;
}
}
rctx->iobuflen = OCSP_MAX_LINE_LEN;
rctx->iobuf = malloc(rctx->iobuflen);
if (!rctx->iobuf) {
+ BIO_free(rctx->mem);
free(rctx);
return 0;
}
if (BIO_printf(rctx->mem, post_hdr, path) <= 0) {
free(rctx->iobuf);
+ BIO_free(rctx->mem);
free(rctx);
return 0;
}
if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) {
free(rctx->iobuf);
+ BIO_free(rctx->mem);
free(rctx);
return 0;
}
ret->verify_cb=0;
if ((ret->param = X509_VERIFY_PARAM_new()) == NULL) {
+ sk_X509_OBJECT_free(ret->objs);
free(ret);
return NULL;
}
b64_str = malloc(der_len * 2);
if(!der_spki || !b64_str) {
X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
+ free(der_spki);
+ free(b64_str);
return NULL;
}
p = der_spki;