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
parent ed36caabfd
commit afe159bfb9
No known key found for this signature in database
GPG Key ID: 99324EF4A00734E0

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;