From f89406ac7240a69ceeb9902a4edae7b7a8fdc7cb Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Tue, 30 Aug 2016 23:22:41 +0000 Subject: [PATCH] MbedTLS: Misc sizeof prettiness --- libratbox/src/mbedtls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libratbox/src/mbedtls.c b/libratbox/src/mbedtls.c index c6a55210..875b6864 100644 --- a/libratbox/src/mbedtls.c +++ b/libratbox/src/mbedtls.c @@ -140,7 +140,7 @@ rb_mbedtls_cfg_new(void) rb_mbedtls_cfg_context *cfg; int ret; - if((cfg = rb_malloc(sizeof(rb_mbedtls_cfg_context))) == NULL) + if((cfg = rb_malloc(sizeof *cfg)) == NULL) return NULL; mbedtls_x509_crt_init(&cfg->crt); @@ -731,7 +731,7 @@ rb_connect_tcp_ssl(rb_fde_t *const F, struct sockaddr *const dest, struct sockad if(F == NULL) return; - struct ssl_connect *const sconn = rb_malloc(sizeof(struct ssl_connect)); + struct ssl_connect *const sconn = rb_malloc(sizeof *sconn); sconn->data = data; sconn->callback = callback; sconn->timeout = timeout; @@ -749,7 +749,7 @@ rb_ssl_start_connected(rb_fde_t *const F, CNCB *const callback, void *const data F->connect->data = data; F->type |= RB_FD_SSL; - struct ssl_connect *const sconn = rb_malloc(sizeof(struct ssl_connect)); + struct ssl_connect *const sconn = rb_malloc(sizeof *sconn); sconn->data = data; sconn->callback = callback; sconn->timeout = timeout;