diff options
author | tobhe <> | 2022-11-10 12:37:00 +0000 |
---|---|---|
committer | tobhe <> | 2022-11-10 12:37:00 +0000 |
commit | 27cfbee98d1ded4c10ba4f51d87f6bf6cf802cc8 (patch) | |
tree | 0e7c13bf24eb44de4251378b332c445a5ccb65c0 /src/lib/libcrypto/dsa/dsa_prn.c | |
parent | d331786cfdba704608438b4b33c00d6b283f4adf (diff) | |
download | openbsd-27cfbee98d1ded4c10ba4f51d87f6bf6cf802cc8.tar.gz openbsd-27cfbee98d1ded4c10ba4f51d87f6bf6cf802cc8.tar.bz2 openbsd-27cfbee98d1ded4c10ba4f51d87f6bf6cf802cc8.zip |
Fix a few more leaks in *_print() functions.
ok jsing@
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_prn.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_prn.c b/src/lib/libcrypto/dsa/dsa_prn.c index a26f3cfc6a..a2063283ea 100644 --- a/src/lib/libcrypto/dsa/dsa_prn.c +++ b/src/lib/libcrypto/dsa/dsa_prn.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_prn.c,v 1.7 2022/11/08 19:17:05 tobhe Exp $ */ | 1 | /* $OpenBSD: dsa_prn.c,v 1.8 2022/11/10 12:37:00 tobhe Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -116,12 +116,16 @@ int | |||
116 | DSAparams_print(BIO *bp, const DSA *x) | 116 | DSAparams_print(BIO *bp, const DSA *x) |
117 | { | 117 | { |
118 | EVP_PKEY *pk; | 118 | EVP_PKEY *pk; |
119 | int ret; | 119 | int ret = 0; |
120 | |||
121 | if ((pk = EVP_PKEY_new()) == NULL) | ||
122 | goto err; | ||
123 | |||
124 | if (!EVP_PKEY_set1_DSA(pk, (DSA *)x)) | ||
125 | goto err; | ||
120 | 126 | ||
121 | pk = EVP_PKEY_new(); | ||
122 | if (!pk || !EVP_PKEY_set1_DSA(pk, (DSA *)x)) | ||
123 | return 0; | ||
124 | ret = EVP_PKEY_print_params(bp, pk, 4, NULL); | 127 | ret = EVP_PKEY_print_params(bp, pk, 4, NULL); |
128 | err: | ||
125 | EVP_PKEY_free(pk); | 129 | EVP_PKEY_free(pk); |
126 | return ret; | 130 | return ret; |
127 | } | 131 | } |