From: Dr. Stephen Henson Date: Thu, 9 Jan 2003 13:06:49 +0000 (+0000) Subject: NULL tofree when it is freed to avoid double free. X-Git-Tag: OpenSSL_0_9_7a~86^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b7249f3021cb90bcdbd336c75c7699f8b8caf19;p=openssl NULL tofree when it is freed to avoid double free. Make sure key is not NULL before freeing it. --- diff --git a/apps/ca.c b/apps/ca.c index c413a0318f..0ef23ad79f 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -597,7 +597,10 @@ bad: goto err; } if(tofree) + { OPENSSL_free(tofree); + tofree = NULL; + } if (!load_config(bio_err, conf)) goto err; @@ -1642,7 +1645,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);