summaryrefslogtreecommitdiff
path: root/apps/ca.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-03-14 14:32:48 +0000
committerMatt Caswell <matt@openssl.org>2018-03-15 12:51:34 +0000
commit01985122ae2b144cdd3a2061640e76bff491dc7f (patch)
tree26eea063a3994b3993541f5e07a47e43da385853 /apps/ca.c
parent5af88441f4fb1951a0672c0c0e1979cd44acdb69 (diff)
downloadopenssl-new-01985122ae2b144cdd3a2061640e76bff491dc7f.tar.gz
Fix a memory leak in the ca application
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5444)
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 743e48185b..d530cf5cd7 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1861,11 +1861,11 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
irow = NULL;
ok = 1;
end:
- if (irow != NULL) {
+ if (ok != 1) {
for (i = 0; i < DB_NUMBER; i++)
OPENSSL_free(row[i]);
- OPENSSL_free(irow);
}
+ OPENSSL_free(irow);
X509_NAME_free(CAname);
X509_NAME_free(subject);