X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fengine%2Feng_lib.c;h=388e8ca8771eb5802d5ae5c478c11eb0e581ec80;hp=c477c7efc5e01c85587eb2e83746d21edbb131c3;hb=7984f082d5045b3a44839b74e4c72877b71ca48f;hpb=16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c index c477c7efc5..388e8ca877 100644 --- a/crypto/engine/eng_lib.c +++ b/crypto/engine/eng_lib.c @@ -1,4 +1,3 @@ -/* crypto/engine/eng_lib.c */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2000. @@ -66,15 +65,14 @@ ENGINE *ENGINE_new(void) { ENGINE *ret; - ret = OPENSSL_malloc(sizeof(*ret)); + ret = OPENSSL_zalloc(sizeof(*ret)); if (ret == NULL) { ENGINEerr(ENGINE_F_ENGINE_NEW, ERR_R_MALLOC_FAILURE); return NULL; } - memset(ret, 0, sizeof(*ret)); ret->struct_ref = 1; - engine_ref_debug(ret, 0, 1) - CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data); + engine_ref_debug(ret, 0, 1); + CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data); return ret; } @@ -91,7 +89,6 @@ void engine_set_all_null(ENGINE *e) e->dsa_meth = NULL; e->dh_meth = NULL; e->rand_meth = NULL; - e->store_meth = NULL; e->ciphers = NULL; e->digests = NULL; e->destroy = NULL; @@ -164,7 +161,7 @@ static int int_cleanup_check(int create) static ENGINE_CLEANUP_ITEM *int_cleanup_item(ENGINE_CLEANUP_CB *cb) { ENGINE_CLEANUP_ITEM *item = OPENSSL_malloc(sizeof(*item)); - if (!item) + if (item == NULL) return NULL; item->cb = cb; return item; @@ -213,14 +210,6 @@ void ENGINE_cleanup(void) /* Now the "ex_data" support */ -int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func) -{ - return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, argl, argp, - new_func, dup_func, free_func); -} - int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg) { return (CRYPTO_set_ex_data(&e->ex_data, idx, arg));