Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/openssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2003-01-09 16:05:57 +0300
committerDr. Stephen Henson <steve@openssl.org>2003-01-09 16:05:57 +0300
commit8ce73486251fad4cfbf25ab7503bdafb1b5c1d6d (patch)
tree1d566c8e2ca5605b0806a23b876d8126a4bb5ea6 /apps
parent3f1cbad2e7eb8f8c53dbabdfa28776a97e2e108f (diff)
NULL tofree when it is freed to avoid double free.
Make sure key is not NULL before freeing it.
Diffstat (limited to 'apps')
-rw-r--r--apps/ca.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 93e61f610b..5b490c80ec 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -76,6 +76,8 @@
#include <openssl/ocsp.h>
#include <openssl/pem.h>
+#include <dmalloc.h>
+
#ifdef OPENSSL_SYS_WINDOWS
#define strcasecmp _stricmp
#else
@@ -597,7 +599,10 @@ bad:
goto err;
}
if(tofree)
+ {
OPENSSL_free(tofree);
+ tofree = NULL;
+ }
if (!load_config(bio_err, conf))
goto err;
@@ -1637,7 +1642,7 @@ err:
if (ret) ERR_print_errors(bio_err);
app_RAND_write_file(randfile, bio_err);
- if (free_key)
+ if (free_key && key)
OPENSSL_free(key);
BN_free(serial);
TXT_DB_free(db);