From 852fcec6fe7cfa5d7c83e2f494208588dd4b4031 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Mon, 21 Apr 2014 16:34:43 +0000 Subject: more malloc/realloc/calloc cleanups; ok beck kettenis --- src/lib/libssl/t1_lib.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/lib/libssl/t1_lib.c') diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index 85d0fa4970..01ecf9479d 100644 --- a/src/lib/libssl/t1_lib.c +++ b/src/lib/libssl/t1_lib.c @@ -506,8 +506,7 @@ ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) if (!s->session->tlsext_tick) return NULL; memcpy(s->session->tlsext_tick, - s->tlsext_session_ticket->data, - ticklen); + s->tlsext_session_ticket->data, ticklen); s->session->tlsext_ticklen = ticklen; } else ticklen = 0; @@ -1029,7 +1028,8 @@ ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, *al = TLS1_AD_UNRECOGNIZED_NAME; return 0; } - if ((s->session->tlsext_hostname = malloc(len + 1)) == NULL) { + if ((s->session->tlsext_hostname = + malloc(len + 1)) == NULL) { *al = TLS1_AD_INTERNAL_ERROR; return 0; } @@ -1101,7 +1101,8 @@ ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, s->session->tlsext_ecpointformatlist = NULL; } s->session->tlsext_ecpointformatlist_length = 0; - if ((s->session->tlsext_ecpointformatlist = malloc(ecpointformatlist_length)) == NULL) { + if ((s->session->tlsext_ecpointformatlist = + malloc(ecpointformatlist_length)) == NULL) { *al = TLS1_AD_INTERNAL_ERROR; return 0; } @@ -1132,7 +1133,8 @@ ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, return 0; } s->session->tlsext_ellipticcurvelist_length = 0; - if ((s->session->tlsext_ellipticcurvelist = malloc(ellipticcurvelist_length)) == NULL) { + if ((s->session->tlsext_ellipticcurvelist = + malloc(ellipticcurvelist_length)) == NULL) { *al = TLS1_AD_INTERNAL_ERROR; return 0; } @@ -1423,7 +1425,8 @@ ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, s->session->tlsext_ecpointformatlist_length = 0; if (s->session->tlsext_ecpointformatlist != NULL) free(s->session->tlsext_ecpointformatlist); - if ((s->session->tlsext_ecpointformatlist = malloc(ecpointformatlist_length)) == NULL) { + if ((s->session->tlsext_ecpointformatlist = + malloc(ecpointformatlist_length)) == NULL) { *al = TLS1_AD_INTERNAL_ERROR; return 0; } -- cgit v1.2.3-55-g6feb