session: fix unbind coverity warning

Type:fix

Change-Id: If4fce6bd9b06ed545d72df847afd6a74cdefe042
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c
index 8f9ce3f..c55aab3 100755
--- a/src/vnet/session/session_api.c
+++ b/src/vnet/session/session_api.c
@@ -968,10 +968,17 @@
       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;