Coverity 189185: access_log: guarantee no null wsi vhost

This commit is contained in:
Andy Green 2018-04-04 10:37:00 +08:00
parent ece243f961
commit 43f9a8de80

View file

@ -51,8 +51,11 @@ lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth)
time_t t = time(NULL);
int l = 256, m;
if (!wsi->vhost)
return;
/* only worry about preparing it if we store it */
if (wsi->vhost && wsi->vhost->log_fd == (int)LWS_INVALID_FILE)
if (wsi->vhost->log_fd == (int)LWS_INVALID_FILE)
return;
if (wsi->access_log_pending)