aboutsummaryrefslogtreecommitdiff
path: root/extmod/moducryptolib.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-04-22 17:09:15 +1000
committerDamien George <damien@micropython.org>2022-05-03 22:28:14 +1000
commit0e7bfc88c6ac6b5d64240f91183a3cfe2ab67ade (patch)
treeb578372082eb5b661263d61a1194af3868968cf9 /extmod/moducryptolib.c
parent6a3bc0e1a1f4dc0ad0b71ca0f168ad1a87d28859 (diff)
all: Use mp_obj_malloc everywhere it's applicable.
This replaces occurences of foo_t *foo = m_new_obj(foo_t); foo->base.type = &foo_type; with foo_t *foo = mp_obj_malloc(foo_t, &foo_type); Excludes any places where base is a sub-field or when new0/memset is used. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/moducryptolib.c')
-rw-r--r--extmod/moducryptolib.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/extmod/moducryptolib.c b/extmod/moducryptolib.c
index 6c89d6d9f..50cdbfa72 100644
--- a/extmod/moducryptolib.c
+++ b/extmod/moducryptolib.c
@@ -228,8 +228,7 @@ STATIC mp_obj_t ucryptolib_aes_make_new(const mp_obj_type_t *type, size_t n_args
mp_raise_ValueError(MP_ERROR_TEXT("mode"));
}
- mp_obj_aes_t *o = m_new_obj_var(mp_obj_aes_t, struct ctr_params, !!is_ctr_mode(block_mode));
- o->base.type = type;
+ mp_obj_aes_t *o = mp_obj_malloc_var(mp_obj_aes_t, struct ctr_params, !!is_ctr_mode(block_mode), type);
o->block_mode = block_mode;
o->key_type = AES_KEYTYPE_NONE;