}
} else tmpval = NULL;
mhdr = (MIME_HEADER *) malloc(sizeof(MIME_HEADER));
- if(!mhdr) return NULL;
+ if (!mhdr)
+ return NULL;
mhdr->name = tmpname;
mhdr->value = tmpval;
- if(!(mhdr->params = sk_MIME_PARAM_new(mime_param_cmp))) return NULL;
+ if (!(mhdr->params = sk_MIME_PARAM_new(mime_param_cmp))) {
+ free(mhdr);
+ return NULL;
+ }
return mhdr;
}
else
rctx->iobuflen = OCSP_MAX_LINE_LEN;
rctx->iobuf = malloc(rctx->iobuflen);
- if (!rctx->iobuf)
+ if (!rctx->iobuf) {
+ free(rctx);
return 0;
+ }
if (!path)
path = "/";
- if (BIO_printf(rctx->mem, post_hdr, path) <= 0)
+ if (BIO_printf(rctx->mem, post_hdr, path) <= 0) {
+ free(rctx->iobuf);
+ free(rctx);
return 0;
+ }
- if (req && !OCSP_REQ_CTX_set1_req(rctx, req))
+ if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) {
+ free(rctx->iobuf);
+ free(rctx);
return 0;
+ }
return rctx;
}
return NULL;
}
if (!derive_pvk_key(keybuf, p, saltlen,
- (unsigned char *)psbuf, inlen))
+ (unsigned char *)psbuf, inlen)) {
+ free(enctmp);
return NULL;
+ }
p += saltlen;
/* Copy BLOBHEADER across, decrypt rest */
memcpy(enctmp, p, 8);
ret->verify=0;
ret->verify_cb=0;
- if ((ret->param = X509_VERIFY_PARAM_new()) == NULL)
+ if ((ret->param = X509_VERIFY_PARAM_new()) == NULL) {
+ free(ret);
return NULL;
+ }
ret->get_issuer = 0;
ret->check_issued = 0;
}
} else tmpval = NULL;
mhdr = (MIME_HEADER *) malloc(sizeof(MIME_HEADER));
- if(!mhdr) return NULL;
+ if (!mhdr)
+ return NULL;
mhdr->name = tmpname;
mhdr->value = tmpval;
- if(!(mhdr->params = sk_MIME_PARAM_new(mime_param_cmp))) return NULL;
+ if (!(mhdr->params = sk_MIME_PARAM_new(mime_param_cmp))) {
+ free(mhdr);
+ return NULL;
+ }
return mhdr;
}
else
rctx->iobuflen = OCSP_MAX_LINE_LEN;
rctx->iobuf = malloc(rctx->iobuflen);
- if (!rctx->iobuf)
+ if (!rctx->iobuf) {
+ free(rctx);
return 0;
+ }
if (!path)
path = "/";
- if (BIO_printf(rctx->mem, post_hdr, path) <= 0)
+ if (BIO_printf(rctx->mem, post_hdr, path) <= 0) {
+ free(rctx->iobuf);
+ free(rctx);
return 0;
+ }
- if (req && !OCSP_REQ_CTX_set1_req(rctx, req))
+ if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) {
+ free(rctx->iobuf);
+ free(rctx);
return 0;
+ }
return rctx;
}
return NULL;
}
if (!derive_pvk_key(keybuf, p, saltlen,
- (unsigned char *)psbuf, inlen))
+ (unsigned char *)psbuf, inlen)) {
+ free(enctmp);
return NULL;
+ }
p += saltlen;
/* Copy BLOBHEADER across, decrypt rest */
memcpy(enctmp, p, 8);
ret->verify=0;
ret->verify_cb=0;
- if ((ret->param = X509_VERIFY_PARAM_new()) == NULL)
+ if ((ret->param = X509_VERIFY_PARAM_new()) == NULL) {
+ free(ret);
return NULL;
+ }
ret->get_issuer = 0;
ret->check_issued = 0;