diff options
author | 2015-09-13 13:44:07 +0000 | |
---|---|---|
committer | 2015-09-13 13:44:07 +0000 | |
commit | fd9ac1c5355ac463747bb3a84bce777dcbd4549b (patch) | |
tree | 0bf283567180139fcfabb78cd8848c45ae6121b0 /lib/libtls/tls.c | |
parent | Add copy-mode -e to exit copy mode when scrolling off the bottom, useful (diff) | |
download | wireguard-openbsd-fd9ac1c5355ac463747bb3a84bce777dcbd4549b.tar.xz wireguard-openbsd-fd9ac1c5355ac463747bb3a84bce777dcbd4549b.zip |
Don't leak conninfo - spotted by marko kreen.
ok jsing@
Diffstat (limited to 'lib/libtls/tls.c')
-rw-r--r-- | lib/libtls/tls.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libtls/tls.c b/lib/libtls/tls.c index 277970c932e..4f89a40be49 100644 --- a/lib/libtls/tls.c +++ b/lib/libtls/tls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls.c,v 1.27 2015/09/12 21:00:38 beck Exp $ */ +/* $OpenBSD: tls.c,v 1.28 2015/09/13 13:44:07 beck Exp $ */ /* * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> * @@ -380,7 +380,8 @@ tls_handshake(struct tls *ctx) { int rv = -1; - if ((ctx->conninfo = calloc(1, sizeof(*ctx->conninfo))) == NULL) + if (ctx->conninfo == NULL && + (ctx->conninfo = calloc(1, sizeof(*ctx->conninfo))) == NULL) goto out; if ((ctx->flags & TLS_CLIENT) != 0) |