From eaebb892b8f9c3a39dd15441584fa8d1e87290ae Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 12 Jul 2019 13:37:26 -0500 Subject: [PATCH] hx509: hx509_context_free(&null_var) should work --- lib/hx509/cert.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/hx509/cert.c b/lib/hx509/cert.c index 107d405b6..2c657331f 100644 --- a/lib/hx509/cert.c +++ b/lib/hx509/cert.c @@ -178,6 +178,9 @@ hx509_context_set_missing_revoke(hx509_context context, int flag) HX509_LIB_FUNCTION void HX509_LIB_CALL hx509_context_free(hx509_context *context) { + if (!*context) + return; + hx509_clear_error_string(*context); if ((*context)->ks_ops) { free((*context)->ks_ops);