esp_https_server: fix coverity warning about null pointer dereference
@@ -287,8 +287,10 @@ static httpd_ssl_ctx_t *create_secure_context(const struct httpd_ssl_config *con
return ssl_ctx;
exit:
+ if (cfg) {
free((void *) cfg->servercert_buf);
free((void *) cfg->cacert_buf);
+ }
free(cfg);
free(ssl_ctx);
return NULL;
