diff options
author | jsing <> | 2018-11-10 02:23:28 +0000 |
---|---|---|
committer | jsing <> | 2018-11-10 02:23:28 +0000 |
commit | 6ea5780b428cd2c90de56fc0f9099c8a4cfdc6f8 (patch) | |
tree | 1b07cee7667e6ede70954fb0e47fba557d02abc8 | |
parent | 725d1c899520cfd3a0c6bbab4e3dc2bcfb34729f (diff) | |
download | openbsd-6ea5780b428cd2c90de56fc0f9099c8a4cfdc6f8.tar.gz openbsd-6ea5780b428cd2c90de56fc0f9099c8a4cfdc6f8.tar.bz2 openbsd-6ea5780b428cd2c90de56fc0f9099c8a4cfdc6f8.zip |
Clean up and free objects at the completion of the regress test.
From Ben L <bobsayshilol at live dot co dot uk>.
-rw-r--r-- | src/regress/lib/libcrypto/pkcs7/pkcs7test.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/pkcs7/pkcs7test.c b/src/regress/lib/libcrypto/pkcs7/pkcs7test.c index 5548307375..5a72586ca8 100644 --- a/src/regress/lib/libcrypto/pkcs7/pkcs7test.c +++ b/src/regress/lib/libcrypto/pkcs7/pkcs7test.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pkcs7test.c,v 1.3 2014/11/26 05:48:00 bcook Exp $ */ | 1 | /* $OpenBSD: pkcs7test.c,v 1.4 2018/11/10 02:23:28 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -203,10 +203,12 @@ main(int argc, char **argv) | |||
203 | fatal("PEM_read_bio_PKCS7"); | 203 | fatal("PEM_read_bio_PKCS7"); |
204 | if (PKCS7_decrypt(p7, pkey, cert, bio_out, 0) != 1) | 204 | if (PKCS7_decrypt(p7, pkey, cert, bio_out, 0) != 1) |
205 | fatal("PKCS7_decrypt"); | 205 | fatal("PKCS7_decrypt"); |
206 | PKCS7_free(p7); | ||
206 | 207 | ||
207 | len = BIO_get_mem_data(bio_out, &out); | 208 | len = BIO_get_mem_data(bio_out, &out); |
208 | message_compare(out, len); | 209 | message_compare(out, len); |
209 | 210 | ||
211 | BIO_free(bio_in); | ||
210 | BIO_free(bio_out); | 212 | BIO_free(bio_out); |
211 | 213 | ||
212 | /* | 214 | /* |
@@ -235,6 +237,7 @@ main(int argc, char **argv) | |||
235 | fatal("PEM_read_bio_PKCS7"); | 237 | fatal("PEM_read_bio_PKCS7"); |
236 | if (PKCS7_verify(p7, certs, store, NULL, bio_out, 0) != 1) | 238 | if (PKCS7_verify(p7, certs, store, NULL, bio_out, 0) != 1) |
237 | fatal("PKCS7_verify"); | 239 | fatal("PKCS7_verify"); |
240 | PKCS7_free(p7); | ||
238 | 241 | ||
239 | len = BIO_get_mem_data(bio_out, &out); | 242 | len = BIO_get_mem_data(bio_out, &out); |
240 | message_compare(out, len); | 243 | message_compare(out, len); |
@@ -277,6 +280,7 @@ main(int argc, char **argv) | |||
277 | fatal("PEM_read_bio_PKCS7"); | 280 | fatal("PEM_read_bio_PKCS7"); |
278 | if (PKCS7_verify(p7, certs, store, bio_content, bio_out, flags) != 1) | 281 | if (PKCS7_verify(p7, certs, store, bio_content, bio_out, flags) != 1) |
279 | fatal("PKCS7_verify"); | 282 | fatal("PKCS7_verify"); |
283 | PKCS7_free(p7); | ||
280 | 284 | ||
281 | len = BIO_get_mem_data(bio_out, &out); | 285 | len = BIO_get_mem_data(bio_out, &out); |
282 | message_compare(out, len); | 286 | message_compare(out, len); |
@@ -284,6 +288,14 @@ main(int argc, char **argv) | |||
284 | BIO_free(bio_in); | 288 | BIO_free(bio_in); |
285 | BIO_free(bio_out); | 289 | BIO_free(bio_out); |
286 | BIO_free(bio_content); | 290 | BIO_free(bio_content); |
291 | BIO_free(bio_cert); | ||
292 | BIO_free(bio_pkey); | ||
293 | |||
294 | EVP_PKEY_free(pkey); | ||
295 | |||
296 | X509_free(cert); | ||
297 | X509_STORE_free(store); | ||
298 | sk_X509_free(certs); | ||
287 | 299 | ||
288 | return 0; | 300 | return 0; |
289 | } | 301 | } |