BUG/MINOR: ssl: ssl_sock_load_ocsp_response_from_file memory leak
"set ssl cert <filename.ocsp> <payload>" CLI command must free
previous context.
This patch should be backport to 2.1
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index fd350f3..7d654bd 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -1106,7 +1106,12 @@
ocsp_response = NULL;
goto end;
}
-
+ /* no error, fill ckch with new context, old context must be free */
+ if (ckch->ocsp_response) {
+ free(ckch->ocsp_response->area);
+ ckch->ocsp_response->area = NULL;
+ free(ckch->ocsp_response);
+ }
ckch->ocsp_response = ocsp_response;
ret = 0;
end: