summaryrefslogtreecommitdiff
path: root/extmod/modtls_axtls.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-02-16 11:02:58 +1100
committerDamien George <damien@micropython.org>2024-02-20 10:32:55 +1100
commitcae690d047900b842beaa7798b5362b5646130af (patch)
tree69ff5f9e627bd859c0865ba8223ffe00058ffdf7 /extmod/modtls_axtls.c
parent4133c0304011ff7be23f47516aac20ed54505e7a (diff)
all: Use mp_obj_malloc_with_finaliser everywhere it's applicable.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/modtls_axtls.c')
-rw-r--r--extmod/modtls_axtls.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/extmod/modtls_axtls.c b/extmod/modtls_axtls.c
index 1ac40208d..4f6b06f66 100644
--- a/extmod/modtls_axtls.c
+++ b/extmod/modtls_axtls.c
@@ -145,11 +145,10 @@ STATIC mp_obj_t ssl_context_make_new(const mp_obj_type_t *type_in, size_t n_args
// Create SSLContext object.
#if MICROPY_PY_SSL_FINALISER
- mp_obj_ssl_context_t *self = m_new_obj_with_finaliser(mp_obj_ssl_context_t);
+ mp_obj_ssl_context_t *self = mp_obj_malloc_with_finaliser(mp_obj_ssl_context_t, type_in);
#else
- mp_obj_ssl_context_t *self = m_new_obj(mp_obj_ssl_context_t);
+ mp_obj_ssl_context_t *self = mp_obj_malloc(mp_obj_ssl_context_t, type_in);
#endif
- self->base.type = type_in;
self->key = mp_const_none;
self->cert = mp_const_none;
@@ -210,11 +209,10 @@ STATIC mp_obj_t ssl_socket_make_new(mp_obj_ssl_context_t *ssl_context, mp_obj_t
bool server_side, bool do_handshake_on_connect, mp_obj_t server_hostname) {
#if MICROPY_PY_SSL_FINALISER
- mp_obj_ssl_socket_t *o = m_new_obj_with_finaliser(mp_obj_ssl_socket_t);
+ mp_obj_ssl_socket_t *o = mp_obj_malloc_with_finaliser(mp_obj_ssl_socket_t, &ssl_socket_type);
#else
- mp_obj_ssl_socket_t *o = m_new_obj(mp_obj_ssl_socket_t);
+ mp_obj_ssl_socket_t *o = mp_obj_malloc(mp_obj_ssl_socket_t, &ssl_socket_type);
#endif
- o->base.type = &ssl_socket_type;
o->buf = NULL;
o->bytes_left = 0;
o->sock = MP_OBJ_NULL;