diff options
author | 2014-06-11 13:19:53 +0000 | |
---|---|---|
committer | 2014-06-11 13:19:53 +0000 | |
commit | b036fe7190c84877255dc5a6e941c25526fbe97c (patch) | |
tree | 128342f1336e23e7b474f70635463911705489cd /lib/libssl/d1_lib.c | |
parent | Always create a local route for every configured IPv4 address on the (diff) | |
download | wireguard-openbsd-b036fe7190c84877255dc5a6e941c25526fbe97c.tar.xz wireguard-openbsd-b036fe7190c84877255dc5a6e941c25526fbe97c.zip |
Fix memory leak: free s if calloc fails.
(From Jonas Maebe)
OK from beck@
Diffstat (limited to 'lib/libssl/d1_lib.c')
-rw-r--r-- | lib/libssl/d1_lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libssl/d1_lib.c b/lib/libssl/d1_lib.c index 4ee3e361681..c417c295df8 100644 --- a/lib/libssl/d1_lib.c +++ b/lib/libssl/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; */ |