session: fix sapi coverity warning 45/29045/2
authorFlorin Coras <fcoras@cisco.com>
Wed, 23 Sep 2020 17:31:27 +0000 (10:31 -0700)
committerDave Barach <openvpp@barachs.net>
Wed, 23 Sep 2020 22:15:17 +0000 (22:15 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib00ac02eabb06a300d01697b89d97b26dd3c4330

src/vnet/session/session_api.c

index 1403e67..e7f95d2 100644 (file)
@@ -1225,6 +1225,8 @@ sapi_send_fds (app_worker_t * app_wrk, int *fds, int n_fds)
   app_ns = app_namespace_get (app->ns_index);
   cs_index = appns_sapi_handle_sock_index (app_wrk->api_client_index);
   cs = appns_sapi_get_socket (app_ns, cs_index);
+  if (PREDICT_FALSE (!cs))
+    return;
 
   /* There's no payload for the message only the type */
   smsg.type = APP_SAPI_MSG_TYPE_SEND_FDS;