diff options
| author | jsing <> | 2018-02-10 04:48:44 +0000 |
|---|---|---|
| committer | jsing <> | 2018-02-10 04:48:44 +0000 |
| commit | 0865717e89a23608e9e870a932e575c2eee93965 (patch) | |
| tree | 701c6ca451d4e90dc0d1d8ff94e41c87683441e4 /src | |
| parent | 3855930890e55b15f6866463de7926d47bc5f967 (diff) | |
| download | openbsd-0865717e89a23608e9e870a932e575c2eee93965.tar.gz openbsd-0865717e89a23608e9e870a932e575c2eee93965.tar.bz2 openbsd-0865717e89a23608e9e870a932e575c2eee93965.zip | |
Tidy/standardise some code.
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls_conninfo.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libtls/tls_conninfo.c b/src/lib/libtls/tls_conninfo.c index 208d1e1062..8e479ed84c 100644 --- a/src/lib/libtls/tls_conninfo.c +++ b/src/lib/libtls/tls_conninfo.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_conninfo.c,v 1.19 2018/02/10 04:48:17 jsing Exp $ */ | 1 | /* $OpenBSD: tls_conninfo.c,v 1.20 2018/02/10 04:48:44 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> |
| 4 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
| @@ -244,8 +244,7 @@ tls_conninfo_populate(struct tls *ctx) | |||
| 244 | 244 | ||
| 245 | if ((tmp = SSL_get_cipher(ctx->ssl_conn)) == NULL) | 245 | if ((tmp = SSL_get_cipher(ctx->ssl_conn)) == NULL) |
| 246 | goto err; | 246 | goto err; |
| 247 | ctx->conninfo->cipher = strdup(tmp); | 247 | if ((ctx->conninfo->cipher = strdup(tmp)) == NULL) |
| 248 | if (ctx->conninfo->cipher == NULL) | ||
| 249 | goto err; | 248 | goto err; |
| 250 | 249 | ||
| 251 | if (ctx->servername != NULL) { | 250 | if (ctx->servername != NULL) { |
| @@ -256,8 +255,7 @@ tls_conninfo_populate(struct tls *ctx) | |||
| 256 | 255 | ||
| 257 | if ((tmp = SSL_get_version(ctx->ssl_conn)) == NULL) | 256 | if ((tmp = SSL_get_version(ctx->ssl_conn)) == NULL) |
| 258 | goto err; | 257 | goto err; |
| 259 | ctx->conninfo->version = strdup(tmp); | 258 | if ((ctx->conninfo->version = strdup(tmp)) == NULL) |
| 260 | if (ctx->conninfo->version == NULL) | ||
| 261 | goto err; | 259 | goto err; |
| 262 | 260 | ||
| 263 | if (tls_get_peer_cert_info(ctx) == -1) | 261 | if (tls_get_peer_cert_info(ctx) == -1) |
| @@ -337,4 +335,3 @@ tls_conn_version(struct tls *ctx) | |||
| 337 | return (NULL); | 335 | return (NULL); |
| 338 | return (ctx->conninfo->version); | 336 | return (ctx->conninfo->version); |
| 339 | } | 337 | } |
| 340 | |||
