aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-11-21 20:24:19 +0000
committerRob Austein <sra@hactrn.net>2013-11-21 20:24:19 +0000
commit1d2b63247ab52456f2f4dbe71a65ce5b4e173b5c (patch)
treea99fa98f45c547926fc07469147d75b76583a79e /utils
parent13a6590a73f29032bbc4683a39958de069c5158d (diff)
New -c option in print_roa and print_rpki_manifest triggered latent
bug in BIO cleanup. svn path=/trunk/; revision=5593
Diffstat (limited to 'utils')
-rw-r--r--utils/print_roa/print_roa.c6
-rw-r--r--utils/print_rpki_manifest/print_rpki_manifest.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/utils/print_roa/print_roa.c b/utils/print_roa/print_roa.c
index a5dc0750..98f0985a 100644
--- a/utils/print_roa/print_roa.c
+++ b/utils/print_roa/print_roa.c
@@ -136,13 +136,14 @@ static ROA *read_roa(const char *filename,
const ASN1_OBJECT *oid = NULL;
ROA *r = NULL;
char buf[512];
- BIO *b;
+ BIO *b = NULL;
int i, j, k, n;
if ((b = BIO_new_file(filename, "r")) == NULL ||
(cms = d2i_CMS_bio(b, NULL)) == NULL)
goto done;
BIO_free(b);
+ b = NULL;
if (print_signerinfo) {
STACK_OF(CMS_SignerInfo) *signerInfos = CMS_get0_SignerInfos(cms);
@@ -190,6 +191,8 @@ static ROA *read_roa(const char *filename,
CMS_verify(cms, NULL, NULL, NULL, b, CMS_NOCRL | CMS_NO_SIGNER_CERT_VERIFY | CMS_NO_ATTR_VERIFY | CMS_NO_CONTENT_VERIFY) <= 0 ||
(r = ASN1_item_d2i_bio(ASN1_ITEM_rptr(ROA), b, NULL)) == NULL)
goto done;
+ BIO_free(b);
+ b = NULL;
if (print_roa) {
@@ -290,6 +293,7 @@ static ROA *read_roa(const char *filename,
BIO_set_fd(b, 1, BIO_NOCLOSE);
CMS_ContentInfo_print_ctx(b, cms, 0, NULL);
BIO_free(b);
+ b = NULL;
}
done:
diff --git a/utils/print_rpki_manifest/print_rpki_manifest.c b/utils/print_rpki_manifest/print_rpki_manifest.c
index f113e824..508850a3 100644
--- a/utils/print_rpki_manifest/print_rpki_manifest.c
+++ b/utils/print_rpki_manifest/print_rpki_manifest.c
@@ -59,13 +59,14 @@ static const Manifest *read_manifest(const char *filename,
const ASN1_OBJECT *oid = NULL;
const Manifest *m = NULL;
char buf[512];
- BIO *b;
+ BIO *b = NULL;
int i, j;
if ((b = BIO_new_file(filename, "r")) == NULL ||
(cms = d2i_CMS_bio(b, NULL)) == NULL)
goto done;
BIO_free(b);
+ b = NULL;
if (print_signerinfo) {
STACK_OF(CMS_SignerInfo) *signerInfos = CMS_get0_SignerInfos(cms);
@@ -113,6 +114,8 @@ static const Manifest *read_manifest(const char *filename,
CMS_verify(cms, NULL, NULL, NULL, b, CMS_NOCRL | CMS_NO_SIGNER_CERT_VERIFY | CMS_NO_ATTR_VERIFY | CMS_NO_CONTENT_VERIFY) <= 0 ||
(m = ASN1_item_d2i_bio(ASN1_ITEM_rptr(Manifest), b, NULL)) == NULL)
goto done;
+ BIO_free(b);
+ b = NULL;
if (print_manifest) {
@@ -152,6 +155,7 @@ static const Manifest *read_manifest(const char *filename,
BIO_set_fd(b, 1, BIO_NOCLOSE);
CMS_ContentInfo_print_ctx(b, cms, 0, NULL);
BIO_free(b);
+ b = NULL;
}
done: