session: fix unbind coverity warning 76/21576/2
authorFlorin Coras <fcoras@cisco.com>
Tue, 27 Aug 2019 22:13:35 +0000 (15:13 -0700)
committerDamjan Marion <dmarion@me.com>
Wed, 28 Aug 2019 15:04:19 +0000 (15:04 +0000)
Type:fix

Change-Id: If4fce6bd9b06ed545d72df847afd6a74cdefe042
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/session/session_api.c

index 8f9ce3f..c55aab3 100755 (executable)
@@ -968,10 +968,17 @@ vl_api_unbind_sock_t_handler (vl_api_unbind_sock_t * mp)
       if ((rv = vnet_unlisten (a)))
        clib_warning ("unlisten returned: %d", rv);
     }
+  else
+    {
+      rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
+    }
 
 done:
   REPLY_MACRO (VL_API_UNBIND_SOCK_REPLY);
 
+  if (!app)
+    return;
+
   app_wrk = application_get_worker (app, a->wrk_map_index);
   if (!app_wrk)
     return;