diff options
author | 2017-05-06 21:25:15 +0000 | |
---|---|---|
committer | 2017-05-06 21:25:15 +0000 | |
commit | 55177a383a974273e6d8cd8f2e29101bc2313c87 (patch) | |
tree | 79d10ad0e73423307f1f7fb9113f2b1c6343016b | |
parent | Add more functions. (diff) | |
download | wireguard-openbsd-55177a383a974273e6d8cd8f2e29101bc2313c87.tar.xz wireguard-openbsd-55177a383a974273e6d8cd8f2e29101bc2313c87.zip |
BIO_free_all() and EVP_PKEY_free() can be called with NULL.
-rw-r--r-- | lib/libtls/tls_util.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libtls/tls_util.c b/lib/libtls/tls_util.c index c643b4a9f62..39504940cf6 100644 --- a/lib/libtls/tls_util.c +++ b/lib/libtls/tls_util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_util.c,v 1.6 2017/05/06 20:57:45 jsing Exp $ */ +/* $OpenBSD: tls_util.c,v 1.7 2017/05/06 21:25:15 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -171,10 +171,8 @@ tls_load_file(const char *name, size_t *len, char *password) free(buf); if (fd != -1) close(fd); - if (bio != NULL) - BIO_free_all(bio); - if (key != NULL) - EVP_PKEY_free(key); + BIO_free_all(bio); + EVP_PKEY_free(key); return (NULL); } |