diff options
| author | doug <> | 2015-07-19 05:50:47 +0000 |
|---|---|---|
| committer | doug <> | 2015-07-19 05:50:47 +0000 |
| commit | 1c740041508f320397165c29f07ea4f6f26959a0 (patch) | |
| tree | c17e88c73e695a15c8cb8f37aa68a6d51da5b100 | |
| parent | 4123c44848bf55d4b325a7280702cc4e1f8f9c6a (diff) | |
| download | openbsd-1c740041508f320397165c29f07ea4f6f26959a0.tar.gz openbsd-1c740041508f320397165c29f07ea4f6f26959a0.tar.bz2 openbsd-1c740041508f320397165c29f07ea4f6f26959a0.zip | |
Free memory when finished.
Fixes coverity 78835.
ok bcook@
| -rw-r--r-- | src/usr.bin/openssl/ca.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c index 74fd8193d3..c7b685ad2b 100644 --- a/src/usr.bin/openssl/ca.c +++ b/src/usr.bin/openssl/ca.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ca.c,v 1.6 2015/07/19 01:10:25 doug Exp $ */ | 1 | /* $OpenBSD: ca.c,v 1.7 2015/07/19 05:50:47 doug Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -1516,6 +1516,7 @@ do_body(X509 ** xret, EVP_PKEY * pkey, X509 * x509, const EVP_MD * dgst, | |||
| 1516 | ASN1_UTCTIME *tm, *tmptm; | 1516 | ASN1_UTCTIME *tm, *tmptm; |
| 1517 | ASN1_STRING *str, *str2; | 1517 | ASN1_STRING *str, *str2; |
| 1518 | ASN1_OBJECT *obj; | 1518 | ASN1_OBJECT *obj; |
| 1519 | ASN1_INTEGER *check_int; | ||
| 1519 | X509 *ret = NULL; | 1520 | X509 *ret = NULL; |
| 1520 | X509_CINF *ci; | 1521 | X509_CINF *ci; |
| 1521 | X509_NAME_ENTRY *ne; | 1522 | X509_NAME_ENTRY *ne; |
| @@ -1805,8 +1806,11 @@ again2: | |||
| 1805 | goto err; | 1806 | goto err; |
| 1806 | #endif | 1807 | #endif |
| 1807 | 1808 | ||
| 1808 | if (BN_to_ASN1_INTEGER(serial, ci->serialNumber) == NULL) | 1809 | if ((check_int = BN_to_ASN1_INTEGER(serial, ci->serialNumber)) == NULL) |
| 1809 | goto err; | 1810 | goto err; |
| 1811 | M_ASN1_INTEGER_free(check_int); | ||
| 1812 | check_int = NULL; | ||
| 1813 | |||
| 1810 | if (selfsign) { | 1814 | if (selfsign) { |
| 1811 | if (!X509_set_issuer_name(ret, subject)) | 1815 | if (!X509_set_issuer_name(ret, subject)) |
| 1812 | goto err; | 1816 | goto err; |
