Make sure key is not NULL before freeing it.
#include <openssl/ocsp.h>
#include <openssl/pem.h>
+#include <dmalloc.h>
+
#ifdef OPENSSL_SYS_WINDOWS
#define strcasecmp _stricmp
#else
goto err;
}
if(tofree)
+ {
OPENSSL_free(tofree);
+ tofree = NULL;
+ }
if (!load_config(bio_err, conf))
goto 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);