From d104de63d5769e2ac03df4b99e7bdff192eb2154 Mon Sep 17 00:00:00 2001 From: kakwa Date: Fri, 2 Sep 2016 08:00:04 +0200 Subject: [PATCH] adding a function to free the ssl context --- inc/rfc3161.h | 1 + src/lib/http.c | 1 + src/lib/rfc3161.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/inc/rfc3161.h b/inc/rfc3161.h index b28348f..cf72f68 100644 --- a/inc/rfc3161.h +++ b/inc/rfc3161.h @@ -39,3 +39,4 @@ TS_RESP_CTX *create_tsctx(rfc3161_context *ct, CONF *conf, const char *section, const char *policy); int add_oid_section(rfc3161_context *ct, CONF *conf); void init_ssl(); +void free_ssl(); diff --git a/src/lib/http.c b/src/lib/http.c index 8cba1f9..a19ea77 100644 --- a/src/lib/http.c +++ b/src/lib/http.c @@ -206,6 +206,7 @@ int http_server_start(char *conffile, char *conf_wd, bool stdout_dbg) { // Stop the server. mg_stop(ctx); free(ct); + free_ssl(); return 0; } diff --git a/src/lib/rfc3161.c b/src/lib/rfc3161.c index cb013a2..3b263b4 100644 --- a/src/lib/rfc3161.c +++ b/src/lib/rfc3161.c @@ -73,6 +73,10 @@ void init_ssl(){ ERR_load_TS_strings(); } +void free_ssl() { + ERR_free_strings(); +} + TS_RESP_CTX *create_tsctx(rfc3161_context *ct, CONF *conf, const char *section, const char *policy) { unsigned long err_code;