summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 6fe990476e7..ee22ccbe0ad 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -457,7 +457,10 @@ stream_session_connect_notify (transport_connection_t * tc, u8 is_fail)
/* Get the app's index from the handle we stored when opening connection
* and the opaque (api_context for external apps) from transport session
* index*/
- app = application_get (handle >> 32);
+ app = application_get_if_valid (handle >> 32);
+ if (!app)
+ return -1;
+
opaque = tc->s_index;
if (!is_fail)
@@ -562,9 +565,7 @@ stream_session_delete_notify (transport_connection_t * tc)
/* App might've been removed already */
s = stream_session_get_if_valid (tc->s_index, tc->thread_index);
if (!s)
- {
- return;
- }
+ return;
stream_session_delete (s);
}