http: fix coverity warning
[vpp.git] / src / plugins / http / http.c
index 503752c..d404e73 100644 (file)
@@ -261,6 +261,7 @@ http_ts_connected_callback (u32 http_app_index, u32 ho_hc_index, session_t *ts,
   as->connection_index = hc->c_c_index;
   as->app_wrk_index = hc->h_pa_wrk_index;
   as->session_state = SESSION_STATE_READY;
+  as->opaque = hc->h_pa_app_api_ctx;
   as->session_type = session_type_from_proto_and_ip (
     TRANSPORT_PROTO_HTTP, session_type_is_ip4 (ts->session_type));
 
@@ -503,7 +504,8 @@ state_srv_wait_method (http_conn_t *hc, transport_send_params_t *sp)
   hc->http_state = HTTP_STATE_WAIT_APP;
 
   app_wrk = app_worker_get_if_valid (as->app_wrk_index);
-  app_worker_rx_notify (app_wrk, as);
+  if (app_wrk)
+    app_worker_rx_notify (app_wrk, as);
 
   return HTTP_SM_STOP;
 
@@ -777,7 +779,9 @@ state_cln_wait_method (http_conn_t *hc, transport_send_params_t *sp)
     }
 
   app_wrk = app_worker_get_if_valid (as->app_wrk_index);
-  app_worker_rx_notify (app_wrk, as);
+  if (app_wrk)
+    app_worker_rx_notify (app_wrk, as);
+
   return HTTP_SM_STOP;
 }