diff options
author | Matt Caswell <matt@openssl.org> | 2015-02-03 16:11:49 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-26 15:02:00 +0000 |
commit | 5fb6f80cdfa418d9429f39f348d7bab8b5f9578a (patch) | |
tree | 451f349a2d00c382eafd8d729b8d35d8b829e504 /ssl/d1_lib.c | |
parent | cb2ce7abfd3e2e641851e0ed9dff1a883b38037e (diff) |
Fix seg fault in dtls1_new
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/d1_lib.c')
-rw-r--r-- | ssl/d1_lib.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index 6ffbf5fc83..f959942113 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -124,6 +124,10 @@ int dtls1_new(SSL *s) { DTLS1_STATE *d1; + if(!DTLS_RECORD_LAYER_new(&s->rlayer)) { + return 0; + } + if (!ssl3_new(s)) return (0); if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL) { @@ -131,12 +135,6 @@ int dtls1_new(SSL *s) return (0); } memset(d1, 0, sizeof *d1); - - if(!DTLS_RECORD_LAYER_new(&s->rlayer)) { - OPENSSL_free(d1); - ssl3_free(s); - return 0; - } d1->buffered_messages = pqueue_new(); d1->sent_messages = pqueue_new(); |