esp_https_server: fix coverity warning about null pointer dereference

This commit is contained in:
Mahavir Jain 2022-11-08 15:45:44 +05:30 committed by Aditya Patwardhan
parent 16e18d9170
commit 8819aa2f38

View File

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