diff options
author | Loganaden Velvindron <logan@cvs.openbsd.org> | 2014-06-11 13:19:54 +0000 |
---|---|---|
committer | Loganaden Velvindron <logan@cvs.openbsd.org> | 2014-06-11 13:19:54 +0000 |
commit | c501fc8163142cf65b6065f7fff8944af48acbcd (patch) | |
tree | 21ba46a00eaf1625bb7e6fb40104371b8f5a8b38 | |
parent | e51920c000fc3bb33ac32431f93c1d14d8993e61 (diff) |
Fix memory leak: free s if calloc fails.
(From Jonas Maebe)
OK from beck@
-rw-r--r-- | lib/libssl/src/ssl/d1_lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libssl/src/ssl/d1_lib.c b/lib/libssl/src/ssl/d1_lib.c index 4ee3e361681..c417c295df8 100644 --- a/lib/libssl/src/ssl/d1_lib.c +++ b/lib/libssl/src/ssl/d1_lib.c @@ -104,8 +104,10 @@ dtls1_new(SSL *s) if (!ssl3_new(s)) return (0); - if ((d1 = calloc(1, sizeof *d1)) == NULL) + if ((d1 = calloc(1, sizeof *d1)) == NULL) { + ssl3_free(s); return (0); + } /* d1->handshake_epoch=0; */ |