summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbeck <>2015-09-13 13:44:07 +0000
committerbeck <>2015-09-13 13:44:07 +0000
commitc4d22677da5e8b9a9a2a2f27a61bc5dc8ad73029 (patch)
tree2cfe044945252a71d0c9e66121180ae117122a53 /src
parent2063ab2c02bc341099214d42806f2b9156acfd41 (diff)
downloadopenbsd-c4d22677da5e8b9a9a2a2f27a61bc5dc8ad73029.tar.gz
openbsd-c4d22677da5e8b9a9a2a2f27a61bc5dc8ad73029.tar.bz2
openbsd-c4d22677da5e8b9a9a2a2f27a61bc5dc8ad73029.zip
Don't leak conninfo - spotted by marko kreen.
ok jsing@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libtls/tls.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libtls/tls.c b/src/lib/libtls/tls.c
index 277970c932..4f89a40be4 100644
--- a/src/lib/libtls/tls.c
+++ b/src/lib/libtls/tls.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls.c,v 1.27 2015/09/12 21:00:38 beck Exp $ */ 1/* $OpenBSD: tls.c,v 1.28 2015/09/13 13:44:07 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -380,7 +380,8 @@ tls_handshake(struct tls *ctx)
380{ 380{
381 int rv = -1; 381 int rv = -1;
382 382
383 if ((ctx->conninfo = calloc(1, sizeof(*ctx->conninfo))) == NULL) 383 if (ctx->conninfo == NULL &&
384 (ctx->conninfo = calloc(1, sizeof(*ctx->conninfo))) == NULL)
384 goto out; 385 goto out;
385 386
386 if ((ctx->flags & TLS_CLIENT) != 0) 387 if ((ctx->flags & TLS_CLIENT) != 0)