summaryrefslogtreecommitdiff
path: root/usr.bin/openssl/dgst.c
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2019-08-30 12:32:15 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2019-08-30 12:32:15 +0000
commit8b6b8091c00ce150b0e20077f8736199e7ad841c (patch)
tree093b8e79cf13d714df4133d7e95e34558fb0a6e2 /usr.bin/openssl/dgst.c
parent0888646cc0925bfa9da0e005a0d80ffd81b95771 (diff)
Remove unnecessary NULL check before free function in openssl(1) dgst
Diffstat (limited to 'usr.bin/openssl/dgst.c')
-rw-r--r--usr.bin/openssl/dgst.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/usr.bin/openssl/dgst.c b/usr.bin/openssl/dgst.c
index 4f71634dbe0..74c31f7d2d8 100644
--- a/usr.bin/openssl/dgst.c
+++ b/usr.bin/openssl/dgst.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dgst.c,v 1.17 2019/08/30 12:09:05 inoguchi Exp $ */
+/* $OpenBSD: dgst.c,v 1.18 2019/08/30 12:32:14 inoguchi Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -462,8 +462,7 @@ dgst_main(int argc, char **argv)
}
r = 1;
mac_end:
- if (mac_ctx)
- EVP_PKEY_CTX_free(mac_ctx);
+ EVP_PKEY_CTX_free(mac_ctx);
if (r == 0)
goto end;
}
@@ -589,18 +588,14 @@ dgst_main(int argc, char **argv)
end:
freezero(buf, BUFSIZE);
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
free(passin);
BIO_free_all(out);
EVP_PKEY_free(sigkey);
- if (dgst_config.sigopts)
- sk_OPENSSL_STRING_free(dgst_config.sigopts);
- if (dgst_config.macopts)
- sk_OPENSSL_STRING_free(dgst_config.macopts);
+ sk_OPENSSL_STRING_free(dgst_config.sigopts);
+ sk_OPENSSL_STRING_free(dgst_config.macopts);
free(sigbuf);
- if (bmd != NULL)
- BIO_free(bmd);
+ BIO_free(bmd);
return (err);
}