arg->argc = 0;
if (arg->size == 0) {
arg->size = 20;
- arg->argv = app_malloc(sizeof(char *) * arg->size, "argv space");
+ arg->argv = app_malloc(sizeof(*arg->argv) * arg->size, "argv space");
if (arg->argv == NULL)
return 0;
}
/* The start of something good :-) */
if (arg->argc >= arg->size) {
arg->size += 20;
- arg->argv = OPENSSL_realloc(arg->argv, sizeof(char *) * arg->size);
+ arg->argv = OPENSSL_realloc(arg->argv,
+ sizeof(*arg->argv) * arg->size);
if (arg->argv == NULL)
return 0;
}
}
}
- retdb = app_malloc(sizeof *retdb, "new DB");
+ retdb = app_malloc(sizeof(*retdb), "new DB");
retdb->db = tmpdb;
tmpdb = NULL;
if (db_attr)
} else { /* UNICODE path */
size_t i, flen = strlen(from) + 1, tlen = strlen(to) + 1;
- tfrom = (TCHAR *)malloc(sizeof(TCHAR) * (flen + tlen));
+ tfrom = malloc(*sizeof(*tfrom) * (flen + tlen));
if (tfrom == NULL)
goto err;
tto = tfrom + flen;
row[DB_type][0] = 'V';
row[DB_type][1] = '\0';
- irow = app_malloc(sizeof(char *) * (DB_NUMBER + 1), "row space");
+ irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row space");
for (i = 0; i < DB_NUMBER; i++) {
irow[i] = row[i];
row[i] = NULL;
row[DB_type][0] = 'V';
row[DB_type][1] = '\0';
- irow = app_malloc(sizeof(char *) * (DB_NUMBER + 1), "row ptr");
+ irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row ptr");
for (i = 0; i < DB_NUMBER; i++) {
irow[i] = row[i];
row[i] = NULL;
}
if (key_param == NULL || key_param->idx != keyidx) {
cms_key_param *nparam;
- nparam = app_malloc(sizeof *nparam, "key param buffer");
+ nparam = app_malloc(sizeof(*nparam), "key param buffer");
nparam->idx = keyidx;
if ((nparam->param = sk_OPENSSL_STRING_new_null()) == NULL)
goto end;
size_t crv_len = EC_get_builtin_curves(NULL, 0);
size_t n;
- curves = app_malloc((int)(sizeof *curves * crv_len), "list curves");
+ curves = app_malloc((int)sizeof(*curves) * crv_len, "list curves");
if (!EC_get_builtin_curves(curves, crv_len)) {
OPENSSL_free(curves);
goto end;
/* Sort alphabetically within category. For nicer help displays. */
for (i = 0, f = functions; f->name != NULL; ++f, ++i) ;
- qsort(functions, i, sizeof *functions, SortFnByName);
+ qsort(functions, i, sizeof(*functions), SortFnByName);
if ((ret = lh_FUNCTION_new()) == NULL)
return (NULL);
static int ssl_excert_prepend(SSL_EXCERT **pexc)
{
- SSL_EXCERT *exc = app_malloc(sizeof *exc, "prepend cert");
+ SSL_EXCERT *exc = app_malloc(sizeof(*exc), "prepend cert");
exc->certfile = NULL;
exc->keyfile = NULL;
{
EBCDIC_OUTBUFF *wbuf;
- wbuf = app_malloc(sizeof(EBCDIC_OUTBUFF) + 1024, "ebcdef wbuf");
+ wbuf = app_malloc(sizeof(*wbuf) + 1024, "ebcdic wbuf");
wbuf->alloced = 1024;
wbuf->buff[0] = '\0';
num = num + num; /* double the size */
if (num < inl)
num = inl;
- wbuf = app_malloc(sizeof(EBCDIC_OUTBUFF) + num, "grow ebcdic wbuf");
+ wbuf = app_malloc(sizeof(*wbuf) + num, "grow ebcdic wbuf");
OPENSSL_free(b->ptr);
wbuf->alloced = num;
static int add_session(SSL *ssl, SSL_SESSION *session)
{
- simple_ssl_session *sess = app_malloc(sizeof *sess, "get session");
+ simple_ssl_session *sess = app_malloc(sizeof(*sess), "get session");
unsigned char *p;
SSL_SESSION_get_id(session, &sess->idlen);
int *fds;
static char sep[] = ":";
- fds = malloc(multi * sizeof *fds);
+ fds = malloc(sizeof(*fds) * multi);
for (n = 0; n < multi; ++n) {
if (pipe(fd) == -1) {
fprintf(stderr, "pipe failure\n");
char **irow;
int i;
- irow = app_malloc(sizeof(char *) * (DB_NUMBER + 1), "row pointers");
+ irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
for (i = 0; i < DB_NUMBER; i++) {
irow[i] = row[i];
row[i] = NULL;
*/
int i, count = *argc;
- char **newargv = app_malloc((count + 1) * sizeof *newargv, "argv copy");
+ char **newargv = app_malloc(sizeof(*newargv) * (count + 1), "argv copy");
for (i = 0; i < count; i++)
newargv[i] = argv[i];
errno = 0;
if (*ctx == NULL) {
- *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX));
+ *ctx = malloc(sizeof(**ctx));
if (*ctx == NULL) {
errno = ENOMEM;
return 0;
}
- memset(*ctx, '\0', sizeof(LP_DIR_CTX));
+ memset(*ctx, '\0', sizeof(**ctx));
(*ctx)->dir = opendir(directory);
if ((*ctx)->dir == NULL) {
return 0;
}
- *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX));
+ *ctx = malloc(sizeof(**ctx));
if (*ctx == NULL) {
errno = ENOMEM;
return 0;
}
- memset(*ctx, '\0', sizeof(LP_DIR_CTX));
+ memset(*ctx, '\0', sizeof(**ctx));
strcpy((*ctx)->filespec, directory);
strcat((*ctx)->filespec, "*.*;");
return 0;
}
- *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX));
+ *ctx = malloc(sizeof(**ctx));
if (*ctx == NULL) {
errno = ENOMEM;
return 0;
}
- memset(*ctx, '\0', sizeof(LP_DIR_CTX));
+ memset(*ctx, '\0', sizeof(**ctx));
if (directory[dirlen - 1] != '*') {
extdirbuf = (char *)malloc(dirlen + 3);
{
ASN1_OBJECT *ret;
- ret = OPENSSL_malloc(sizeof(ASN1_OBJECT));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ASN1err(ASN1_F_ASN1_OBJECT_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
tmp = ASN1_STRING_TABLE_get(nid);
if (tmp && tmp->flags & STABLE_FLAGS_MALLOC)
return tmp;
- rv = OPENSSL_malloc(sizeof(ASN1_STRING_TABLE));
+ rv = OPENSSL_malloc(sizeof(*rv));
if (!rv)
return NULL;
if (!sk_ASN1_STRING_TABLE_push(stable, rv)) {
const char *pem_str, const char *info)
{
EVP_PKEY_ASN1_METHOD *ameth;
- ameth = OPENSSL_malloc(sizeof(EVP_PKEY_ASN1_METHOD));
+ ameth = OPENSSL_malloc(sizeof(*ameth));
if (!ameth)
return NULL;
{
ASN1_STRING *ret;
- ret = OPENSSL_malloc(sizeof(ASN1_STRING));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
}
}
}
- mhdr = OPENSSL_malloc(sizeof(MIME_HEADER));
+ mhdr = OPENSSL_malloc(sizeof(*mhdr));
if (!mhdr)
goto err;
mhdr->name = tmpname;
goto err;
}
/* Parameter values are case sensitive so leave as is */
- mparam = OPENSSL_malloc(sizeof(MIME_PARAM));
+ mparam = OPENSSL_malloc(sizeof(*mparam));
if (!mparam)
goto err;
mparam->param_name = tmpname;
static int asn1_bio_new(BIO *b)
{
BIO_ASN1_BUF_CTX *ctx;
- ctx = OPENSSL_malloc(sizeof(BIO_ASN1_BUF_CTX));
+ ctx = OPENSSL_malloc(sizeof(*ctx));
if (!ctx)
return 0;
if (!asn1_bio_init(ctx, DEFAULT_ASN1_BUF_SIZE)) {
ASN1err(ASN1_F_BIO_NEW_NDEF, ASN1_R_STREAMING_NOT_SUPPORTED);
return NULL;
}
- ndef_aux = OPENSSL_malloc(sizeof(NDEF_SUPPORT));
+ ndef_aux = OPENSSL_malloc(sizeof(*ndef_aux));
asn_bio = BIO_new(BIO_f_asn1());
/* ASN1 bio needs to be next to output BIO */
return 1;
case V_ASN1_ANY:
- typ = OPENSSL_malloc(sizeof(ASN1_TYPE));
+ typ = OPENSSL_malloc(sizeof(*typ));
if (!typ)
return 0;
typ->value.ptr = NULL;
ASN1_PCTX *ASN1_PCTX_new(void)
{
ASN1_PCTX *ret;
- ret = OPENSSL_malloc(sizeof(ASN1_PCTX));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ASN1err(ASN1_F_ASN1_PCTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx))
{
ASN1_SCTX *ret;
- ret = OPENSSL_malloc(sizeof(ASN1_SCTX));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ASN1err(ASN1_F_ASN1_SCTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
EVP_PKEY *pk))
{
X509_CRL_METHOD *m;
- m = OPENSSL_malloc(sizeof(X509_CRL_METHOD));
+ m = OPENSSL_malloc(sizeof(*m));
if (!m)
return NULL;
m->crl_init = crl_init;
{
X509_INFO *ret = NULL;
- ret = OPENSSL_malloc(sizeof(X509_INFO));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ASN1err(ASN1_F_X509_INFO_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
{
X509_PKEY *ret = NULL;
- ret = OPENSSL_malloc(sizeof(X509_PKEY));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret)
goto err;
- memset(ret, 0, sizeof(X509_PKEY));
+ memset(ret, 0, sizeof(*ret));
ret->version = 0;
ret->enc_algor = X509_ALGOR_new();
static int buffer_new(BIO *bi)
{
- BIO_F_BUFFER_CTX *ctx;
+ BIO_F_BUFFER_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
- ctx = OPENSSL_malloc(sizeof(BIO_F_BUFFER_CTX));
if (ctx == NULL)
return (0);
ctx->ibuf = OPENSSL_malloc(DEFAULT_BUFFER_SIZE);
{
BIO_LINEBUFFER_CTX *ctx;
- ctx = OPENSSL_malloc(sizeof(BIO_LINEBUFFER_CTX));
+ ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx == NULL)
return (0);
ctx->obuf = OPENSSL_malloc(DEFAULT_LINEBUFFER_SIZE);
{
NBIO_TEST *nt;
- if (!(nt = OPENSSL_malloc(sizeof(NBIO_TEST))))
+ if (!(nt = OPENSSL_malloc(sizeof(*nt))))
return (0);
nt->lrn = -1;
nt->lwn = -1;
BIO *BIO_new(BIO_METHOD *method)
{
- BIO *ret = NULL;
+ BIO *ret = OPENSSL_malloc(sizeof(*ret));
- ret = OPENSSL_malloc(sizeof(BIO));
if (ret == NULL) {
BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
{
BIO_ACCEPT *ret;
- if ((ret = OPENSSL_malloc(sizeof(BIO_ACCEPT))) == NULL)
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
return (NULL);
memset(ret, 0, sizeof(BIO_ACCEPT));
{
struct bio_bio_st *b;
- b = OPENSSL_malloc(sizeof *b);
+ b = OPENSSL_malloc(sizeof(*b));
if (b == NULL)
return 0;
{
BIO_CONNECT *ret;
- if ((ret = OPENSSL_malloc(sizeof(BIO_CONNECT))) == NULL)
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
return (NULL);
ret->state = BIO_CONN_S_BEFORE;
ret->param_hostname = NULL;
bi->init = 0;
bi->num = 0;
- data = OPENSSL_malloc(sizeof(bio_dgram_data));
+ data = OPENSSL_malloc(sizeof(*data));
if (data == NULL)
return 0;
memset(data, 0x00, sizeof(bio_dgram_data));
bi->init = 0;
bi->num = 0;
- data = OPENSSL_malloc(sizeof(bio_dgram_sctp_data));
+ data = OPENSSL_malloc(sizeof(*data));
if (data == NULL)
return 0;
memset(data, 0x00, sizeof(bio_dgram_sctp_data));
bn_depr.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
bn_depr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
bn_depr.o: ../cryptlib.h ../include/internal/bn_int.h bn_depr.c bn_lcl.h
-bn_dh.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
+bn_dh.o: ../../e_os.h ../../include/openssl/bn.h ../../include/openssl/crypto.h
bn_dh.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
bn_dh.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
bn_dh.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
bn_sqrt.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
bn_sqrt.o: ../../include/openssl/symhacks.h ../cryptlib.h
bn_sqrt.o: ../include/internal/bn_int.h bn_lcl.h bn_sqrt.c
-bn_srp.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
-bn_srp.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
-bn_srp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
-bn_srp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
-bn_srp.o: ../../include/openssl/symhacks.h ../include/internal/bn_int.h
-bn_srp.o: bn_lcl.h bn_srp.c
+bn_srp.o: ../../e_os.h ../../include/openssl/bn.h
+bn_srp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
+bn_srp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
+bn_srp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
+bn_srp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+bn_srp.o: ../include/internal/bn_int.h bn_lcl.h bn_srp.c
bn_word.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
bn_word.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
bn_word.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
bn_check_top(mod);
- if ((ret = OPENSSL_malloc(sizeof(BN_BLINDING))) == NULL) {
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) {
BNerr(BN_F_BN_BLINDING_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
}
BN_CTX *BN_CTX_new(void)
{
- BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX));
+ BN_CTX *ret = OPENSSL_malloc(sizeof(*ret));
if (!ret) {
BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
if (p->used == p->size) {
BIGNUM *bn;
unsigned int loop = 0;
- BN_POOL_ITEM *item = OPENSSL_malloc(sizeof(BN_POOL_ITEM));
+ BN_POOL_ITEM *item = OPENSSL_malloc(sizeof(*item));
if (!item)
return NULL;
/* Initialise the structure */
bn_check_top(a);
bn_check_top(b);
bn_check_top(p);
- if ((arr = OPENSSL_malloc(sizeof(int) * max)) == NULL)
+ if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
goto err;
ret = BN_GF2m_poly2arr(p, arr, max);
if (!ret || ret > max) {
bn_check_top(a);
bn_check_top(p);
- if ((arr = OPENSSL_malloc(sizeof(int) * max)) == NULL)
+ if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
goto err;
ret = BN_GF2m_poly2arr(p, arr, max);
if (!ret || ret > max) {
bn_check_top(a);
bn_check_top(b);
bn_check_top(p);
- if ((arr = OPENSSL_malloc(sizeof(int) * max)) == NULL)
+ if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
goto err;
ret = BN_GF2m_poly2arr(p, arr, max);
if (!ret || ret > max) {
int *arr = NULL;
bn_check_top(a);
bn_check_top(p);
- if ((arr = OPENSSL_malloc(sizeof(int) * max)) == NULL)
+ if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
goto err;
ret = BN_GF2m_poly2arr(p, arr, max);
if (!ret || ret > max) {
int *arr = NULL;
bn_check_top(a);
bn_check_top(p);
- if ((arr = OPENSSL_malloc(sizeof(int) * max)) == NULL)
+ if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
goto err;
ret = BN_GF2m_poly2arr(p, arr, max);
if (!ret || ret > max) {
{
BIGNUM *ret;
- if ((ret = OPENSSL_malloc(sizeof(BIGNUM))) == NULL) {
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) {
BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
}
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return (NULL);
}
- a = A = OPENSSL_malloc(sizeof(BN_ULONG) * words);
+ a = A = OPENSSL_malloc(sizeof(*a) * words);
if (A == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return (NULL);
{
BN_GENCB *ret;
- if ((ret = OPENSSL_malloc(sizeof(BN_GENCB))) == NULL) {
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) {
BNerr(BN_F_BN_GENCB_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
}
{
BN_MONT_CTX *ret;
- if ((ret = OPENSSL_malloc(sizeof(BN_MONT_CTX))) == NULL)
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
return (NULL);
BN_MONT_CTX_init(ret);
{
BN_RECP_CTX *ret;
- if ((ret = OPENSSL_malloc(sizeof(BN_RECP_CTX))) == NULL)
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
return (NULL);
BN_RECP_CTX_init(ret);
{
BUF_MEM *ret;
- ret = OPENSSL_malloc(sizeof(BUF_MEM));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
CMAC_CTX *CMAC_CTX_new(void)
{
CMAC_CTX *ctx;
- ctx = OPENSSL_malloc(sizeof(CMAC_CTX));
+
+ ctx = OPENSSL_malloc(sizeof(*ctx));
if (!ctx)
return NULL;
EVP_CIPHER_CTX_init(&ctx->cctx);
static int zlib_stateful_init(COMP_CTX *ctx)
{
int err;
- struct zlib_state *state = OPENSSL_malloc(sizeof(struct zlib_state));
+ struct zlib_state *state = OPENSSL_malloc(sizeof(*state));
if (state == NULL)
goto err;
return 0;
}
# endif
- ctx = OPENSSL_malloc(sizeof(BIO_ZLIB_CTX));
+ ctx = OPENSSL_malloc(sizeof(*ctx));
if (!ctx) {
COMPerr(COMP_F_BIO_ZLIB_NEW, ERR_R_MALLOC_FAILURE);
return 0;
{
COMP_CTX *ret;
- if ((ret = OPENSSL_malloc(sizeof(COMP_CTX))) == NULL) {
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) {
/* ZZZZZZZZZZZZZZZZ */
return (NULL);
}
if ((sk = sk_CONF_VALUE_new_null()) == NULL)
goto err;
- if ((v = OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL)
+ if ((v = OPENSSL_malloc(sizeof(*v))) == NULL)
goto err;
i = strlen(section) + 1;
if ((v->section = OPENSSL_malloc(i)) == NULL)
{
CONF *ret;
- ret = OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret)
if (meth->init(ret) == 0) {
OPENSSL_free(ret);
p++;
*p = '\0';
- if (!(v = OPENSSL_malloc(sizeof(CONF_VALUE)))) {
+ if (!(v = OPENSSL_malloc(sizeof(*v)))) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
goto err;
}
supported_modules = sk_CONF_MODULE_new_null();
if (supported_modules == NULL)
return NULL;
- tmod = OPENSSL_malloc(sizeof(CONF_MODULE));
+ tmod = OPENSSL_malloc(sizeof(*tmod));
if (tmod == NULL)
return NULL;
CONF_IMODULE *imod = NULL;
/* Otherwise add initialized module to list */
- imod = OPENSSL_malloc(sizeof(CONF_IMODULE));
+ imod = OPENSSL_malloc(sizeof(*imod));
if (!imod)
goto err;
DH *DH_new_method(ENGINE *engine)
{
- DH *ret = OPENSSL_malloc(sizeof(DH));
+ DH *ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
DHerr(DH_F_DH_NEW_METHOD, ERR_R_MALLOC_FAILURE);
static int pkey_dh_init(EVP_PKEY_CTX *ctx)
{
DH_PKEY_CTX *dctx;
- dctx = OPENSSL_malloc(sizeof(DH_PKEY_CTX));
+ dctx = OPENSSL_malloc(sizeof(*dctx));
if (!dctx)
return 0;
dctx->prime_len = 1024;
{
if (operation == ASN1_OP_NEW_PRE) {
DSA_SIG *sig;
- sig = OPENSSL_malloc(sizeof(DSA_SIG));
+ sig = OPENSSL_malloc(sizeof(*sig));
if (!sig) {
DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
return 0;
{
DSA *ret;
- ret = OPENSSL_malloc(sizeof(DSA));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
DSAerr(DSA_F_DSA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return (NULL);
static int pkey_dsa_init(EVP_PKEY_CTX *ctx)
{
DSA_PKEY_CTX *dctx;
- dctx = OPENSSL_malloc(sizeof(DSA_PKEY_CTX));
+ dctx = OPENSSL_malloc(sizeof(*dctx));
if (!dctx)
return 0;
dctx->nbits = 1024;
*/
default_DSO_meth = DSO_METHOD_openssl();
}
- ret = OPENSSL_malloc(sizeof(DSO));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
DSOerr(DSO_F_DSO_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return (NULL);
goto err;
}
- p = DSO_MALLOC(sizeof(DSO_VMS_INTERNAL));
+ p = DSO_MALLOC(sizeof(*p));
if (p == NULL) {
DSOerr(DSO_F_VMS_LOAD, ERR_R_MALLOC_FAILURE);
goto err;
ERR_add_error_data(3, "filename(", filename, ")");
goto err;
}
- p = OPENSSL_malloc(sizeof(HINSTANCE));
+ p = OPENSSL_malloc(sizeof(*p));
if (p == NULL) {
DSOerr(DSO_F_WIN32_LOAD, ERR_R_MALLOC_FAILURE);
goto err;
return (NULL);
}
- result = OPENSSL_malloc(sizeof(struct file_st));
+ result = OPENSSL_malloc(sizeof(*result));
if (result == NULL) {
DSOerr(DSO_F_WIN32_SPLITTER, ERR_R_MALLOC_FAILURE);
return (NULL);
ec_check.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_check.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_check.o: ../../include/openssl/symhacks.h ec_check.c ec_lcl.h
-ec_curve.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
-ec_curve.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
-ec_curve.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
-ec_curve.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
-ec_curve.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
+ec_curve.o: ../../e_os.h ../../include/openssl/asn1.h
+ec_curve.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
+ec_curve.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
+ec_curve.o: ../../include/openssl/ec.h ../../include/openssl/err.h
+ec_curve.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+ec_curve.o: ../../include/openssl/opensslconf.h
ec_curve.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_curve.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_curve.o: ../../include/openssl/symhacks.h ec_curve.c ec_lcl.h
EC_KEY *EC_KEY_new(void)
{
- EC_KEY *ret;
+ EC_KEY *ret = OPENSSL_malloc(sizeof(*ret));
- ret = OPENSSL_malloc(sizeof(EC_KEY));
if (ret == NULL) {
ECerr(EC_F_EC_KEY_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
return NULL;
}
- ret = OPENSSL_malloc(sizeof *ret);
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ECerr(EC_F_EC_GROUP_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
BN_clear_free(group->order);
BN_clear_free(group->cofactor);
OPENSSL_clear_free(group->seed, group->seed_len);
- OPENSSL_clear_free(group, sizeof *group);
+ OPENSSL_clear_free(group, sizeof(*group));
}
int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
/* no explicit entry needed */
return 1;
- d = OPENSSL_malloc(sizeof *d);
+ d = OPENSSL_malloc(sizeof(*d));
if (d == NULL)
return 0;
return NULL;
}
- ret = OPENSSL_malloc(sizeof *ret);
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ECerr(EC_F_EC_POINT_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
point->meth->point_clear_finish(point);
else if (point->meth->point_finish != 0)
point->meth->point_finish(point);
- OPENSSL_clear_free(point, sizeof *point);
+ OPENSSL_clear_free(point, sizeof(*point));
}
int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src)
if (!group)
return NULL;
- ret = OPENSSL_malloc(sizeof(EC_PRE_COMP));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret) {
ECerr(EC_F_EC_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
return ret;
for (p = pre->points; *p != NULL; p++) {
EC_POINT_clear_free(*p);
- OPENSSL_cleanse(p, sizeof *p);
+ OPENSSL_cleanse(p, sizeof(*p));
}
OPENSSL_free(pre->points);
}
- OPENSSL_clear_free(pre, sizeof *pre);
+ OPENSSL_clear_free(pre, sizeof(*pre));
}
/*
num = pre_points_per_block * numblocks; /* number of points to compute
* and store */
- points = OPENSSL_malloc(sizeof(EC_POINT *) * (num + 1));
+ points = OPENSSL_malloc(sizeof(*points) * (num + 1));
if (!points) {
ECerr(EC_F_EC_WNAF_PRECOMPUTE_MULT, ERR_R_MALLOC_FAILURE);
goto err;
static int pkey_ec_init(EVP_PKEY_CTX *ctx)
{
EC_PKEY_CTX *dctx;
- dctx = OPENSSL_malloc(sizeof(EC_PKEY_CTX));
+
+ dctx = OPENSSL_malloc(sizeof(*dctx));
if (!dctx)
return 0;
dctx->gen_group = NULL;
static NISTP224_PRE_COMP *nistp224_pre_comp_new()
{
NISTP224_PRE_COMP *ret = NULL;
- ret = OPENSSL_malloc(sizeof *ret);
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret) {
ECerr(EC_F_NISTP224_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
return ret;
if (i > 0)
return;
- OPENSSL_clear_free(pre, sizeof *pre);
+ OPENSSL_clear_free(pre, sizeof(*pre));
}
/******************************************************************************/
static NISTP256_PRE_COMP *nistp256_pre_comp_new()
{
NISTP256_PRE_COMP *ret = NULL;
- ret = OPENSSL_malloc(sizeof *ret);
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret) {
ECerr(EC_F_NISTP256_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
return ret;
if (i > 0)
return;
- OPENSSL_clear_free(pre, sizeof *pre);
+ OPENSSL_clear_free(pre, sizeof(*pre));
}
/******************************************************************************/
static NISTP521_PRE_COMP *nistp521_pre_comp_new()
{
- NISTP521_PRE_COMP *ret = NULL;
- ret = OPENSSL_malloc(sizeof(NISTP521_PRE_COMP));
+ NISTP521_PRE_COMP *ret = OPENSSL_malloc(sizeof(*ret));
+
if (!ret) {
ECerr(EC_F_NISTP521_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
return ret;
if (!group)
return NULL;
- ret = OPENSSL_malloc(sizeof(EC_PRE_COMP));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret) {
ECerr(EC_F_ECP_NISTZ256_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
OPENSSL_clear_free(pre->precomp,
32 * sizeof(unsigned char) * (1 << pre->w) * 2 * 37);
- OPENSSL_clear_free(pre, sizeof *pre);
+ OPENSSL_clear_free(pre, sizeof(*pre));
}
static int ecp_nistz256_window_have_precompute_mult(const EC_GROUP *group)
{
ECDH_DATA *ret;
- ret = OPENSSL_malloc(sizeof(ECDH_DATA));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ECDHerr(ECDH_F_ECDH_DATA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return (NULL);
{
ECDSA_DATA *ret;
- ret = OPENSSL_malloc(sizeof(ECDSA_DATA));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ECDSAerr(ECDSA_F_ECDSA_DATA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return (NULL);
{
ECDSA_METHOD *ret;
- ret = OPENSSL_malloc(sizeof(ECDSA_METHOD));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ECDSAerr(ECDSA_F_ECDSA_METHOD_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
*/
static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
{
- dynamic_data_ctx *c;
- c = OPENSSL_malloc(sizeof(dynamic_data_ctx));
+ dynamic_data_ctx *c = OPENSSL_malloc(sizeof(*c));
+
if (!c) {
ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX, ERR_R_MALLOC_FAILURE);
return 0;
{
ENGINE *ret;
- ret = OPENSSL_malloc(sizeof(ENGINE));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ENGINEerr(ENGINE_F_ENGINE_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
static ENGINE_CLEANUP_ITEM *int_cleanup_item(ENGINE_CLEANUP_CB *cb)
{
- ENGINE_CLEANUP_ITEM *item = OPENSSL_malloc(sizeof(ENGINE_CLEANUP_ITEM));
+ ENGINE_CLEANUP_ITEM *item = OPENSSL_malloc(sizeof(*item));
if (!item)
return NULL;
item->cb = cb;
static int ossl_hmac_init(EVP_PKEY_CTX *ctx)
{
OSSL_HMAC_PKEY_CTX *hctx;
- hctx = OPENSSL_malloc(sizeof(OSSL_HMAC_PKEY_CTX));
+ hctx = OPENSSL_malloc(sizeof(*hctx));
if (!hctx)
return 0;
hctx->md = NULL;
tmplate.nid = *nids;
fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate);
if (!fnd) {
- fnd = OPENSSL_malloc(sizeof(ENGINE_PILE));
+ fnd = OPENSSL_malloc(sizeof(*fnd));
if (!fnd)
goto end;
fnd->uptodate = 1;
char (*dest)[LEN_SYS_STR_REASON] = &(strerror_tab[i - 1]);
char *src = strerror(i);
if (src != NULL) {
- strncpy(*dest, src, sizeof *dest);
- (*dest)[sizeof *dest - 1] = '\0';
+ strncpy(*dest, src, sizeof(*dest));
+ (*dest)[sizeof(*dest) - 1] = '\0';
str->string = *dest;
}
}
/* ret == the error state, if NULL, make a new one */
if (ret == NULL) {
- ret = OPENSSL_malloc(sizeof(ERR_STATE));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL)
return (&fallback);
CRYPTO_THREADID_cpy(&ret->tid, &tid);
{
BIO_B64_CTX *ctx;
- ctx = OPENSSL_malloc(sizeof(BIO_B64_CTX));
+ ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx == NULL)
return (0);
{
BIO_ENC_CTX *ctx;
- ctx = OPENSSL_malloc(sizeof(BIO_ENC_CTX));
+ ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx == NULL)
return (0);
EVP_CIPHER_CTX_init(&ctx->cipher);
{
BIO_OK_CTX *ctx;
- ctx = OPENSSL_malloc(sizeof(BIO_OK_CTX));
+ ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx == NULL)
return (0);
void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
{
- memset(ctx, '\0', sizeof *ctx);
+ memset(ctx, '\0', sizeof(*ctx));
}
EVP_MD_CTX *EVP_MD_CTX_create(void)
{
- EVP_MD_CTX *ctx = OPENSSL_malloc(sizeof *ctx);
+ EVP_MD_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx)
EVP_MD_CTX_init(ctx);
} else
tmp_buf = NULL;
EVP_MD_CTX_cleanup(out);
- memcpy(out, in, sizeof *out);
+ memcpy(out, in, sizeof(*out));
if (in->md_data && out->digest->ctx_size) {
if (tmp_buf)
*/
ENGINE_finish(ctx->engine);
#endif
- memset(ctx, '\0', sizeof *ctx);
+ memset(ctx, '\0', sizeof(*ctx));
return 1;
}
EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
{
- EVP_CIPHER_CTX *ctx = OPENSSL_malloc(sizeof *ctx);
+ EVP_CIPHER_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx)
EVP_CIPHER_CTX_init(ctx);
return ctx;
#endif
EVP_CIPHER_CTX_cleanup(out);
- memcpy(out, in, sizeof *out);
+ memcpy(out, in, sizeof(*out));
if (in->cipher_data && in->cipher->ctx_size) {
out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size);
int md_nid, EVP_PBE_KEYGEN *keygen)
{
EVP_PBE_CTL *pbe_tmp;
+
if (!pbe_algs)
pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
- if (!(pbe_tmp = OPENSSL_malloc(sizeof(EVP_PBE_CTL)))) {
+ if (!(pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp)))) {
EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE);
return 0;
}
{
EVP_PKEY *ret;
- ret = OPENSSL_malloc(sizeof(EVP_PKEY));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
EVPerr(EVP_F_EVP_PKEY_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
return NULL;
}
- ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret) {
#ifndef OPENSSL_NO_ENGINE
if (e)
EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags)
{
EVP_PKEY_METHOD *pmeth;
- pmeth = OPENSSL_malloc(sizeof(EVP_PKEY_METHOD));
+
+ pmeth = OPENSSL_malloc(sizeof(*pmeth));
if (!pmeth)
return NULL;
return 0;
}
#endif
- rctx = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
+ rctx = OPENSSL_malloc(sizeof(*rctx));
if (!rctx)
return NULL;
CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA);
p = lh_EX_CLASS_ITEM_retrieve(ex_data, &d);
if (!p) {
- gen = OPENSSL_malloc(sizeof(EX_CLASS_ITEM));
+ gen = OPENSSL_malloc(sizeof(*gen));
if (gen) {
gen->class_index = class_index;
gen->meth_num = 0;
CRYPTO_EX_free *free_func)
{
int toret = -1;
- CRYPTO_EX_DATA_FUNCS *a = OPENSSL_malloc(sizeof(CRYPTO_EX_DATA_FUNCS));
+ CRYPTO_EX_DATA_FUNCS *a = OPENSSL_malloc(sizeof(*a));
if (!a) {
CRYPTOerr(CRYPTO_F_DEF_ADD_INDEX, ERR_R_MALLOC_FAILURE);
return -1;
static int pkey_hmac_init(EVP_PKEY_CTX *ctx)
{
HMAC_PKEY_CTX *hctx;
- hctx = OPENSSL_malloc(sizeof(HMAC_PKEY_CTX));
+ hctx = OPENSSL_malloc(sizeof(*hctx));
if (!hctx)
return 0;
hctx->md = NULL;
EVP_MD_CTX_cleanup(&ctx->i_ctx);
EVP_MD_CTX_cleanup(&ctx->o_ctx);
EVP_MD_CTX_cleanup(&ctx->md_ctx);
- memset(ctx, 0, sizeof *ctx);
+ memset(ctx, 0, sizeof(*ctx));
}
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
OPENSSL_free(ctx->p.peer_name);
OPENSSL_free(ctx->p.name);
- memset(ctx, '\0', sizeof *ctx);
+ memset(ctx, '\0', sizeof(*ctx));
}
JPAKE_CTX *JPAKE_CTX_new(const char *name, const char *peer_name,
const BIGNUM *p, const BIGNUM *g, const BIGNUM *q,
const BIGNUM *secret)
{
- JPAKE_CTX *ctx = OPENSSL_malloc(sizeof *ctx);
+ JPAKE_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx == NULL)
return NULL;
_LHASH *ret;
int i;
- if ((ret = OPENSSL_malloc(sizeof(_LHASH))) == NULL)
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
goto err0;
- if ((ret->b = OPENSSL_malloc(sizeof(LHASH_NODE *) * MIN_NODES)) == NULL)
+ if ((ret->b = OPENSSL_malloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
goto err1;
for (i = 0; i < MIN_NODES; i++)
ret->b[i] = NULL;
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
- if ((nn = OPENSSL_malloc(sizeof(LHASH_NODE))) == NULL) {
+ if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
lh->error++;
return (NULL);
}
}
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
- pointer = OPENSSL_malloc(sizeof(CRYPTO_dynlock));
+ pointer = OPENSSL_malloc(sizeof(*pointer));
if (pointer == NULL) {
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID, ERR_R_MALLOC_FAILURE);
return (0);
if (is_MemCheck_on()) {
MemCheck_off(); /* obtain MALLOC2 lock */
- if ((ami = OPENSSL_malloc(sizeof(APP_INFO))) == NULL) {
+ if ((ami = OPENSSL_malloc(sizeof(*ami))) == NULL) {
ret = 0;
goto err;
}
if (is_MemCheck_on()) {
MemCheck_off(); /* make sure we hold MALLOC2 lock */
- if ((m = OPENSSL_malloc(sizeof(MEM))) == NULL) {
+ if ((m = OPENSSL_malloc(sizeof(*m))) == NULL) {
OPENSSL_free(addr);
MemCheck_on(); /* release MALLOC2 lock if num_disabled drops
* to 0 */
{
GCM128_CONTEXT *ret;
- if ((ret = OPENSSL_malloc(sizeof(GCM128_CONTEXT))))
+ if ((ret = OPENSSL_malloc(sizeof(*ret))))
CRYPTO_gcm128_init(ret, key, block);
return ret;
OCB128_CONTEXT *octx;
int ret;
- if ((octx = OPENSSL_malloc(sizeof(OCB128_CONTEXT)))) {
+ if ((octx = OPENSSL_malloc(sizeof(*octx)))) {
ret = CRYPTO_ocb128_init(octx, keyenc, keydec, encrypt, decrypt);
if (ret)
return octx;
obj_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
obj_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
obj_lib.o: ../cryptlib.h ../include/internal/asn1_int.h obj_lib.c
-obj_xref.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
-obj_xref.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
-obj_xref.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
-obj_xref.o: ../../include/openssl/opensslconf.h
+obj_xref.o: ../../e_os.h ../../include/openssl/asn1.h
+obj_xref.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
+obj_xref.o: ../../include/openssl/e_os2.h ../../include/openssl/obj_mac.h
+obj_xref.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
obj_xref.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
obj_xref.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
obj_xref.o: ../../include/openssl/symhacks.h obj_xref.c obj_xref.h
names_type_num++;
for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
MemCheck_off();
- name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS));
+ name_funcs = OPENSSL_malloc(sizeof(*name_funcs));
MemCheck_on();
if (!name_funcs) {
OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
alias = type & OBJ_NAME_ALIAS;
type &= ~OBJ_NAME_ALIAS;
- onp = OPENSSL_malloc(sizeof(OBJ_NAME));
+ onp = OPENSSL_malloc(sizeof(*onp));
if (onp == NULL) {
/* ERROR */
return (0);
d.type = type;
d.names =
- OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh) * sizeof *d.names);
+ OPENSSL_malloc(sizeof(*d.names) * lh_OBJ_NAME_num_items(names_lh));
/* Really should return an error if !d.names...but its a void function! */
if (d.names) {
d.n = 0;
OBJ_NAME_do_all(type, do_all_sorted_fn, &d);
- qsort((void *)d.names, d.n, sizeof *d.names, do_all_sorted_cmp);
+ qsort((void *)d.names, d.n, sizeof(*d.names), do_all_sorted_cmp);
for (n = 0; n < d.n; ++n)
fn(d.names[n], arg);
return (0);
if ((o = OBJ_dup(obj)) == NULL)
goto err;
- if (!(ao[ADDED_NID] = OPENSSL_malloc(sizeof(ADDED_OBJ))))
+ if (!(ao[ADDED_NID] = OPENSSL_malloc(sizeof(*ao))))
goto err2;
if ((o->length != 0) && (obj->data != NULL))
- if (!
- (ao[ADDED_DATA] = OPENSSL_malloc(sizeof(ADDED_OBJ))))
+ if (!(ao[ADDED_DATA] = OPENSSL_malloc(sizeof(*ao))))
goto err2;
if (o->sn != NULL)
- if (!
- (ao[ADDED_SNAME] = OPENSSL_malloc(sizeof(ADDED_OBJ))))
+ if (!(ao[ADDED_SNAME] = OPENSSL_malloc(sizeof(*ao))))
goto err2;
if (o->ln != NULL)
- if (!
- (ao[ADDED_LNAME] = OPENSSL_malloc(sizeof(ADDED_OBJ))))
+ if (!(ao[ADDED_LNAME] = OPENSSL_malloc(sizeof(*ao))))
goto err2;
for (i = ADDED_DATA; i <= ADDED_NID; i++) {
sigx_app = sk_nid_triple_new(sigx_cmp);
if (!sigx_app)
return 0;
- ntr = OPENSSL_malloc(sizeof(int) * 3);
+ ntr = OPENSSL_malloc(sizeof(*ntr));
if (!ntr)
return 0;
ntr->sign_id = signid;
OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)
{
- OCSP_REQ_CTX *rctx;
- rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));
+ OCSP_REQ_CTX *rctx = OPENSSL_malloc(sizeof(*rctx));
+
if (!rctx)
return NULL;
rctx->state = OHS_ERROR;
pitem *pitem_new(unsigned char *prio64be, void *data)
{
- pitem *item = OPENSSL_malloc(sizeof(pitem));
+ pitem *item = OPENSSL_malloc(sizeof(*item));
if (item == NULL)
return NULL;
pqueue_s *pqueue_new()
{
- pqueue_s *pq = OPENSSL_malloc(sizeof(pqueue_s));
+ pqueue_s *pq = OPENSSL_malloc(sizeof(*pq));
if (pq == NULL)
return NULL;
{
RSA *ret;
- ret = OPENSSL_malloc(sizeof(RSA));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
RSAerr(RSA_F_RSA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return NULL;
static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
{
RSA_PKEY_CTX *rctx;
- rctx = OPENSSL_malloc(sizeof(RSA_PKEY_CTX));
+ rctx = OPENSSL_malloc(sizeof(*rctx));
if (!rctx)
return 0;
rctx->nbits = 1024;
static SRP_user_pwd *SRP_user_pwd_new(void)
{
- SRP_user_pwd *ret = OPENSSL_malloc(sizeof(SRP_user_pwd));
+ SRP_user_pwd *ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL)
return NULL;
ret->N = NULL;
SRP_VBASE *SRP_VBASE_new(char *seed_key)
{
- SRP_VBASE *vb = OPENSSL_malloc(sizeof(SRP_VBASE));
+ SRP_VBASE *vb = OPENSSL_malloc(sizeof(*vb));
if (vb == NULL)
return NULL;
{
unsigned char tmp[MAX_LEN];
int len;
- SRP_gN_cache *newgN = OPENSSL_malloc(sizeof(SRP_gN_cache));
+ SRP_gN_cache *newgN = OPENSSL_malloc(sizeof(*newgN));
if (newgN == NULL)
return NULL;
* we add this couple in the internal Stack
*/
- if ((gN = OPENSSL_malloc(sizeof(SRP_gN))) == NULL)
+ if ((gN = OPENSSL_malloc(sizeof(*gN))) == NULL)
goto err;
if (!(gN->id = BUF_strdup(pp[DB_srpid]))
ret->sorted = sk->sorted;
ret->num = sk->num;
ret->num_alloc = sk->num > MIN_NODES ? sk->num : MIN_NODES;
- ret->data = OPENSSL_malloc(sizeof(char *) * ret->num_alloc);
+ ret->data = OPENSSL_malloc(sizeof(*ret->data) * ret->num_alloc);
if (ret->data == NULL) {
OPENSSL_free(ret);
return NULL;
if ((ret = OPENSSL_malloc(sizeof(_STACK))) == NULL)
goto err;
- if ((ret->data = OPENSSL_malloc(sizeof(char *) * MIN_NODES)) == NULL)
+ if ((ret->data = OPENSSL_malloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
goto err;
for (i = 0; i < MIN_NODES; i++)
ret->data[i] = NULL;
return NULL;
}
- ret = OPENSSL_malloc(sizeof(STORE));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
STOREerr(STORE_F_STORE_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return NULL;
STORE_OBJECT *STORE_OBJECT_new(void)
{
- STORE_OBJECT *object = OPENSSL_malloc(sizeof(STORE_OBJECT));
+ STORE_OBJECT *object = OPENSSL_malloc(sizeof(*object));
if (object)
- memset(object, 0, sizeof(STORE_OBJECT));
+ memset(object, 0, sizeof(*object));
return object;
}
STORE_ATTR_INFO *STORE_ATTR_INFO_new(void)
{
- return OPENSSL_malloc(sizeof(STORE_ATTR_INFO));
+ STORE_ATTR_INFO *p = OPENSSL_malloc(sizeof(*p));
+
+ return p;
}
static void STORE_ATTR_INFO_attr_free(STORE_ATTR_INFO *attrs,
void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes)
{
if (attributes) {
- struct attr_list_ctx_st *context = (struct attr_list_ctx_st *)
- OPENSSL_malloc(sizeof(struct attr_list_ctx_st));
+ struct attr_list_ctx_st *context = OPENSSL_malloc(sizeof(*context));
if (context)
context->attributes = attributes;
else
OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
- struct mem_ctx_st *context = OPENSSL_malloc(sizeof(struct mem_ctx_st));
+ struct mem_ctx_st *context = OPENSSL_malloc(sizeof(*context));
void *attribute_context = NULL;
STORE_ATTR_INFO *attrs = NULL;
STORE_METHOD *STORE_create_method(char *name)
{
- STORE_METHOD *store_method = OPENSSL_malloc(sizeof(STORE_METHOD));
+ STORE_METHOD *store_method = OPENSSL_malloc(sizeof(*store_method));
if (store_method) {
memset(store_method, 0, sizeof(*store_method));
{
TS_RESP_CTX *ctx;
- if (!(ctx = OPENSSL_malloc(sizeof(TS_RESP_CTX)))) {
+ if (!(ctx = OPENSSL_malloc(sizeof(*ctx)))) {
TSerr(TS_F_TS_RESP_CTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
}
TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
{
- TS_VERIFY_CTX *ctx = OPENSSL_malloc(sizeof(TS_VERIFY_CTX));
+ TS_VERIFY_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
if (ctx)
memset(ctx, 0, sizeof(TS_VERIFY_CTX));
if (!BUF_MEM_grow(buf, size))
goto err;
- if ((ret = OPENSSL_malloc(sizeof(TXT_DB))) == NULL)
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
goto err;
ret->num_fields = num;
ret->index = NULL;
UI *UI_new_method(const UI_METHOD *method)
{
- UI *ret = OPENSSL_malloc(sizeof(UI));
+ UI *ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
UIerr(UI_F_UI_NEW_METHOD, ERR_R_MALLOC_FAILURE);
} else if ((type == UIT_PROMPT || type == UIT_VERIFY
|| type == UIT_BOOLEAN) && result_buf == NULL) {
UIerr(UI_F_GENERAL_ALLOCATE_PROMPT, UI_R_NO_RESULT_BUFFER);
- } else if ((ret = OPENSSL_malloc(sizeof(UI_STRING)))) {
+ } else if ((ret = OPENSSL_malloc(sizeof(*ret)))) {
ret->out_string = prompt;
ret->flags = prompt_freeable ? OUT_STRING_FREEABLE : 0;
ret->input_flags = input_flags;
UI_METHOD *UI_create_method(char *name)
{
- UI_METHOD *ui_method = OPENSSL_malloc(sizeof(UI_METHOD));
+ UI_METHOD *ui_method = OPENSSL_malloc(sizeof(*ui_method));
if (ui_method) {
memset(ui_method, 0, sizeof(*ui_method));
{
BY_DIR *a;
- if ((a = OPENSSL_malloc(sizeof(BY_DIR))) == NULL)
+ if ((a = OPENSSL_malloc(sizeof(*a))) == NULL)
return (0);
if ((a->buffer = BUF_MEM_new()) == NULL) {
OPENSSL_free(a);
return 0;
}
}
- ent = OPENSSL_malloc(sizeof(BY_DIR_ENTRY));
+ ent = OPENSSL_malloc(sizeof(*ent));
if (!ent)
return 0;
ent->dir_type = type;
hent = sk_BY_DIR_HASH_value(ent->hashes, idx);
}
if (!hent) {
- hent = OPENSSL_malloc(sizeof(BY_DIR_HASH));
+ hent = OPENSSL_malloc(sizeof(*hent));
if (hent == NULL) {
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);
{
X509_LOOKUP *ret;
- ret = OPENSSL_malloc(sizeof(X509_LOOKUP));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL)
return NULL;
{
X509_STORE *ret;
- if ((ret = OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
+ if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
return NULL;
ret->objs = sk_X509_OBJECT_new(x509_object_cmp);
ret->cache = 1;
if (x == NULL)
return 0;
- obj = OPENSSL_malloc(sizeof(X509_OBJECT));
+ obj = OPENSSL_malloc(sizeof(*obj));
if (obj == NULL) {
X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE);
return 0;
if (x == NULL)
return 0;
- obj = OPENSSL_malloc(sizeof(X509_OBJECT));
+ obj = OPENSSL_malloc(sizeof(*obj));
if (obj == NULL) {
X509err(X509_F_X509_STORE_ADD_CRL, ERR_R_MALLOC_FAILURE);
return 0;
idx = X509_TRUST_get_by_id(id);
/* Need a new entry */
if (idx == -1) {
- if (!(trtmp = OPENSSL_malloc(sizeof(X509_TRUST)))) {
+ if (!(trtmp = OPENSSL_malloc(sizeof(*trtmp)))) {
X509err(X509_F_X509_TRUST_ADD, ERR_R_MALLOC_FAILURE);
return 0;
}
X509_STORE_CTX *X509_STORE_CTX_new(void)
{
- X509_STORE_CTX *ctx;
+ X509_STORE_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
- ctx = OPENSSL_malloc(sizeof(X509_STORE_CTX));
if (!ctx) {
X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
X509_VERIFY_PARAM *param;
X509_VERIFY_PARAM_ID *paramid;
- param = OPENSSL_malloc(sizeof *param);
+ param = OPENSSL_malloc(sizeof(*param));
if (!param)
return NULL;
- paramid = OPENSSL_malloc(sizeof *paramid);
+ paramid = OPENSSL_malloc(sizeof(*paramid));
if (!paramid) {
OPENSSL_free(param);
return NULL;
}
- memset(param, 0, sizeof *param);
- memset(paramid, 0, sizeof *paramid);
+ memset(param, 0, sizeof(*param));
+ memset(paramid, 0, sizeof(*paramid));
param->id = paramid;
x509_verify_param_zero(param);
return param;
static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it)
{
- X509_NAME *ret = NULL;
- ret = OPENSSL_malloc(sizeof(X509_NAME));
+ X509_NAME *ret = OPENSSL_malloc(sizeof(*ret));
+
if (!ret)
goto memerr;
if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL)
CERTIFICATEPOLICIES *ext_cpols = NULL;
POLICY_MAPPINGS *ext_pmaps = NULL;
int i;
- cache = OPENSSL_malloc(sizeof(X509_POLICY_CACHE));
+ cache = OPENSSL_malloc(sizeof(*cache));
if (!cache)
return 0;
cache->anyPolicy = NULL;
return NULL;
} else
id = NULL;
- ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret)
return NULL;
ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
X509_POLICY_TREE *tree)
{
X509_POLICY_NODE *node;
- node = OPENSSL_malloc(sizeof(X509_POLICY_NODE));
+ node = OPENSSL_malloc(sizeof(*node));
if (!node)
return NULL;
node->data = data;
/* If we get this far initialize the tree */
- tree = OPENSSL_malloc(sizeof(X509_POLICY_TREE));
+ tree = OPENSSL_malloc(sizeof(*tree));
if (!tree)
return 0;
tree->flags = 0;
- tree->levels = OPENSSL_malloc(sizeof(X509_POLICY_LEVEL) * n);
+ tree->levels = OPENSSL_malloc(sizeof(*tree->levels) * n);
tree->nlevel = 0;
tree->extra_data = NULL;
tree->auth_policies = NULL;
ASRange *r;
switch (a->type) {
case ASIdOrRange_id:
- if ((r = OPENSSL_malloc(sizeof(ASRange))) == NULL) {
+ if ((r = OPENSSL_malloc(sizeof(*r))) == NULL) {
X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
ERR_R_MALLOC_FAILURE);
goto done;
X509V3_R_EXTENSION_NOT_FOUND);
return 0;
}
- if (!(tmpext = OPENSSL_malloc(sizeof(X509V3_EXT_METHOD)))) {
+ if (!(tmpext = OPENSSL_malloc(sizeof(*tmpext)))) {
X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS, ERR_R_MALLOC_FAILURE);
return 0;
}
idx = X509_PURPOSE_get_by_id(id);
/* Need a new entry */
if (idx == -1) {
- if (!(ptmp = OPENSSL_malloc(sizeof(X509_PURPOSE)))) {
+ if (!(ptmp = OPENSSL_malloc(sizeof(*ptmp)))) {
X509V3err(X509V3_F_X509_PURPOSE_ADD, ERR_R_MALLOC_FAILURE);
return 0;
}
goto err;
listlen -= sctlen;
- sct = OPENSSL_malloc(sizeof(SCT));
+ sct = OPENSSL_malloc(sizeof(*sct));
if (!sct)
goto err;
if (!sk_SCT_push(sk, sct)) {
goto err;
if (value && !(tvalue = BUF_strdup(value)))
goto err;
- if (!(vtmp = OPENSSL_malloc(sizeof(CONF_VALUE))))
+ if (!(vtmp = OPENSSL_malloc(sizeof(*vtmp))))
goto err;
if (!*extlist && !(*extlist = sk_CONF_VALUE_new_null()))
goto err;
SSLStateMachine *SSLStateMachine_new(const char *szCertificateFile,
const char *szKeyFile)
{
- SSLStateMachine *pMachine = malloc(sizeof *pMachine);
+ SSLStateMachine *pMachine = malloc(sizeof(*pMachine));
int n;
die_unless(pMachine);
{
struct gost_pmeth_data *data;
EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(ctx);
- data = OPENSSL_malloc(sizeof(struct gost_pmeth_data));
+
+ data = OPENSSL_malloc(sizeof(*data));
if (!data)
return 0;
memset(data, 0, sizeof(struct gost_pmeth_data));
/* -------- PKEY_METHOD for GOST MAC algorithm --------------------*/
static int pkey_gost_mac_init(EVP_PKEY_CTX *ctx)
{
- struct gost_mac_pmeth_data *data;
- data = OPENSSL_malloc(sizeof(struct gost_mac_pmeth_data));
+ struct gost_mac_pmeth_data *data = OPENSSL_malloc(sizeof(*data));
+
if (!data)
return 0;
memset(data, 0, sizeof(struct gost_mac_pmeth_data));
static CAPI_KEY *capi_get_key(CAPI_CTX * ctx, const TCHAR *contname,
TCHAR *provname, DWORD ptype, DWORD keyspec)
{
- CAPI_KEY *key;
DWORD dwFlags = 0;
- key = OPENSSL_malloc(sizeof(CAPI_KEY));
+ CAPI_KEY *key = OPENSSL_malloc(sizeof(*key));
+
if (key == NULL)
return NULL;
if (sizeof(TCHAR) == sizeof(char))
static CAPI_CTX *capi_ctx_new()
{
- CAPI_CTX *ctx;
- ctx = OPENSSL_malloc(sizeof(CAPI_CTX));
+ CAPI_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
+
if (!ctx) {
CAPIerr(CAPI_F_CAPI_CTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
goto err;
}
# ifndef OPENSSL_NO_RSA
- hptr = OPENSSL_malloc(sizeof(HWCryptoHook_RSAKeyHandle));
+ hptr = OPENSSL_malloc(sizeof(*hptr));
if (!hptr) {
HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE);
goto err;
static E_GMP_RSA_CTX *e_gmp_get_rsa(RSA *rsa)
{
E_GMP_RSA_CTX *hptr = RSA_get_ex_data(rsa, hndidx_rsa);
+
if (hptr)
return hptr;
- hptr = OPENSSL_malloc(sizeof(E_GMP_RSA_CTX));
+ hptr = OPENSSL_malloc(sizeof(*hptr));
if (!hptr)
return NULL;
/*
static int ssl_new(BIO *bi)
{
- BIO_SSL *bs;
+ BIO_SSL *bs = OPENSSL_malloc(sizeof(*bs));
- bs = OPENSSL_malloc(sizeof(BIO_SSL));
if (bs == NULL) {
BIOerr(BIO_F_SSL_NEW, ERR_R_MALLOC_FAILURE);
return (0);
unsigned char *buf = NULL;
unsigned char *bitmask = NULL;
- frag = OPENSSL_malloc(sizeof(hm_fragment));
+ frag = OPENSSL_malloc(sizeof(*frag));
if (frag == NULL)
return NULL;
if (!ssl3_new(s))
return (0);
- if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL) {
+ if ((d1 = OPENSSL_malloc(sizeof(*d1))) == NULL) {
ssl3_free(s);
return (0);
}
- memset(d1, 0, sizeof *d1);
+ memset(d1, 0, sizeof(*d1));
d1->buffered_messages = pqueue_new();
d1->sent_messages = pqueue_new();
{
DTLS_RECORD_LAYER *d;
- if ((d = OPENSSL_malloc(sizeof *d)) == NULL) {
+ if ((d = OPENSSL_malloc(sizeof(*d))) == NULL)
return (0);
- }
rl->d = d;
unprocessed_rcds = d->unprocessed_rcds.q;
processed_rcds = d->processed_rcds.q;
buffered_app_data = d->buffered_app_data.q;
- memset(d, 0, sizeof *d);
+ memset(d, 0, sizeof(*d));
d->unprocessed_rcds.q = unprocessed_rcds;
d->processed_rcds.q = processed_rcds;
d->buffered_app_data.q = buffered_app_data;
if (pqueue_size(queue->q) >= 100)
return 0;
- rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA));
+ rdata = OPENSSL_malloc(sizeof(*rdata));
item = pitem_new(priority, rdata);
if (rdata == NULL || item == NULL) {
OPENSSL_free(rdata);
if (s->enc_read_ctx != NULL)
reuse_dd = 1;
else if ((s->enc_read_ctx =
- OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
+ OPENSSL_malloc(sizeof(*s->enc_read_ctx))) == NULL)
goto err;
else
/*
if (s->enc_write_ctx != NULL)
reuse_dd = 1;
else if ((s->enc_write_ctx =
- OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
+ OPENSSL_malloc(sizeof(*s->enc_write_ctx))) == NULL)
goto err;
else
/*
{
SSL3_STATE *s3;
- if ((s3 = OPENSSL_malloc(sizeof *s3)) == NULL)
+ if ((s3 = OPENSSL_malloc(sizeof(*s3))) == NULL)
goto err;
- memset(s3, 0, sizeof *s3);
+ memset(s3, 0, sizeof(*s3));
s->s3 = s3;
#ifndef OPENSSL_NO_SRP
#ifndef OPENSSL_NO_SRP
SSL_SRP_CTX_free(s);
#endif
- OPENSSL_clear_free(s->s3, sizeof *s->s3);
+ OPENSSL_clear_free(s->s3, sizeof(*s->s3));
s->s3 = NULL;
}
s->s3->alpn_selected = NULL;
}
#endif
- memset(s->s3, 0, sizeof *s->s3);
+ memset(s->s3, 0, sizeof(*s->s3));
s->s3->init_extra = init_extra;
ssl_free_wbio_buffer(s);
CERT *ssl_cert_new(void)
{
- CERT *ret;
+ CERT *ret = OPENSSL_malloc(sizeof(*ret));
- ret = OPENSSL_malloc(sizeof(CERT));
if (ret == NULL) {
SSLerr(SSL_F_SSL_CERT_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
CERT *ssl_cert_dup(CERT *cert)
{
- CERT *ret;
+ CERT *ret = OPENSSL_malloc(sizeof(*ret));
int i;
- ret = OPENSSL_malloc(sizeof(CERT));
if (ret == NULL) {
SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE);
return (NULL);
{
SESS_CERT *ret;
- ret = OPENSSL_malloc(sizeof *ret);
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
SSLerr(SSL_F_SSL_SESS_CERT_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
}
- memset(ret, 0, sizeof *ret);
+ memset(ret, 0, sizeof(*ret));
ret->peer_key = &(ret->peer_pkeys[SSL_PKEY_RSA_ENC]);
ret->references = 1;
MemCheck_off();
ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
if (ssl_comp_methods != NULL) {
- comp = OPENSSL_malloc(sizeof(SSL_COMP));
+ comp = OPENSSL_malloc(sizeof(*comp));
if (comp != NULL) {
comp->method = COMP_zlib();
if (comp->method && comp->method->type == NID_undef)
fprintf(stderr, "ssl_create_cipher_list() for %d ciphers\n",
num_of_ciphers);
#endif /* KSSL_DEBUG */
- co_list = OPENSSL_malloc(sizeof(CIPHER_ORDER) * num_of_ciphers);
+ co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers);
if (co_list == NULL) {
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
return (NULL); /* Failure */
*/
num_of_group_aliases = OSSL_NELEM(cipher_aliases);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
- ca_list = OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
+ ca_list = OPENSSL_malloc(sizeof(*ca_list) * num_of_alias_max);
if (ca_list == NULL) {
OPENSSL_free(co_list);
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
}
MemCheck_off();
- comp = OPENSSL_malloc(sizeof(SSL_COMP));
+ comp = OPENSSL_malloc(sizeof(*comp));
if (comp == NULL) {
MemCheck_on();
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD, ERR_R_MALLOC_FAILURE);
SSL_CONF_CTX *SSL_CONF_CTX_new(void)
{
- SSL_CONF_CTX *ret;
+ SSL_CONF_CTX *ret = OPENSSL_malloc(sizeof(*ret));
size_t i;
- ret = OPENSSL_malloc(sizeof(SSL_CONF_CTX));
+
if (ret) {
ret->flags = 0;
ret->prefix = NULL;
return (NULL);
}
- s = OPENSSL_malloc(sizeof(SSL));
+ s = OPENSSL_malloc(sizeof(*s));
if (s == NULL)
goto err;
memset(s, 0, sizeof(SSL));
SSLerr(SSL_F_SSL_CTX_NEW, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS);
goto err;
}
- ret = OPENSSL_malloc(sizeof(SSL_CTX));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL)
goto err;
{
SSL_SESSION *ss;
- ss = OPENSSL_malloc(sizeof(SSL_SESSION));
+ ss = OPENSSL_malloc(sizeof(*ss));
if (ss == NULL) {
SSLerr(SSL_F_SSL_SESSION_NEW, ERR_R_MALLOC_FAILURE);
return (0);
if (s->enc_read_ctx != NULL)
reuse_dd = 1;
else if ((s->enc_read_ctx =
- OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL)
+ OPENSSL_malloc(sizeof(*s->enc_read_ctx))) == NULL)
goto err;
else
/*
exptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
exptest.o: ../include/openssl/symhacks.h exptest.c
-gost2814789test.o: ../engines/ccgost/gost89.h ../include/openssl/asn1.h
-gost2814789test.o: ../include/openssl/bio.h ../include/openssl/buffer.h
-gost2814789test.o: ../include/openssl/conf.h ../include/openssl/crypto.h
-gost2814789test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
-gost2814789test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
-gost2814789test.o: ../include/openssl/engine.h ../include/openssl/err.h
-gost2814789test.o: ../include/openssl/evp.h ../include/openssl/hmac.h
-gost2814789test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
-gost2814789test.o: ../include/openssl/objects.h
+gost2814789test.o: ../e_os.h ../engines/ccgost/gost89.h
+gost2814789test.o: ../include/openssl/asn1.h ../include/openssl/bio.h
+gost2814789test.o: ../include/openssl/buffer.h ../include/openssl/conf.h
+gost2814789test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
+gost2814789test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
+gost2814789test.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
+gost2814789test.o: ../include/openssl/err.h ../include/openssl/evp.h
+gost2814789test.o: ../include/openssl/hmac.h ../include/openssl/lhash.h
+gost2814789test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
gost2814789test.o: ../include/openssl/opensslconf.h
gost2814789test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
gost2814789test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
hmactest.o: ../include/openssl/symhacks.h hmactest.c
ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h
ideatest.o: ../include/openssl/opensslconf.h ideatest.c
-igetest.o: ../include/openssl/aes.h ../include/openssl/crypto.h
+igetest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/crypto.h
igetest.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
igetest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
igetest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
ssltest.o: ../include/openssl/x509v3.h ../ssl/record/record.h ../ssl/ssl_locl.h
ssltest.o: ssltest.c
-testutil.o: testutil.c testutil.h
+testutil.o: ../e_os.h ../include/openssl/e_os2.h
+testutil.o: ../include/openssl/opensslconf.h testutil.c testutil.h
v3nametest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
v3nametest.o: ../include/openssl/buffer.h ../include/openssl/conf.h
v3nametest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
/* get a list of all internal curves */
crv_len = EC_get_builtin_curves(NULL, 0);
-
- curves = OPENSSL_malloc(sizeof(EC_builtin_curve) * crv_len);
-
+ curves = OPENSSL_malloc(sizeof(*curves) * crv_len);
if (curves == NULL) {
BIO_printf(out, "malloc error\n");
goto builtin_err;
int ok = 1;
crv_len = EC_get_builtin_curves(NULL, 0);
-
- curves = OPENSSL_malloc(sizeof(EC_builtin_curve) * crv_len);
-
+ curves = OPENSSL_malloc(sizeof(*curves) * crv_len);
if (curves == NULL)
return;
fprintf(stderr, "Duplicate key %s\n", value);
return 0;
}
- key = OPENSSL_malloc(sizeof(struct key_list));
+ key = OPENSSL_malloc(sizeof(*key));
if (!key)
return 0;
key->name = BUF_strdup(value);
}
return 0;
}
- mdat = OPENSSL_malloc(sizeof(struct digest_data));
+ mdat = OPENSSL_malloc(sizeof(*mdat));
mdat->digest = digest;
mdat->input = NULL;
mdat->output = NULL;
}
return 0;
}
- cdat = OPENSSL_malloc(sizeof(struct cipher_data));
+ cdat = OPENSSL_malloc(sizeof(*cdat));
cdat->cipher = cipher;
cdat->enc = -1;
cdat->key = NULL;
else
return 0;
- mdat = OPENSSL_malloc(sizeof(struct mac_data));
+ mdat = OPENSSL_malloc(sizeof(*mdat));
mdat->type = type;
mdat->alg = NULL;
mdat->key = NULL;
return 1;
}
- kdata = OPENSSL_malloc(sizeof(struct pkey_data));
+ kdata = OPENSSL_malloc(sizeof(*kdata));
if (!kdata) {
EVP_PKEY_free(pkey);
return 0;