]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1214196 Dereference null return value, if we hit this condition, something very...
authorMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 14:09:38 +0000 (14:09 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 14:09:38 +0000 (14:09 +0000)
src/mod/applications/mod_spy/mod_spy.c

index 784820d14739fa75455918d8ff007759dfef75c7..1a697fed06e5e62febff20038850aa28f35682c2 100644 (file)
@@ -59,6 +59,11 @@ static switch_status_t spy_on_hangup(switch_core_session_t *session)
        const char *uuid = switch_core_session_get_uuid(session);
        spy_t *spy = NULL, *p = NULL, *prev = NULL;
 
+       if (!data) {
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't call mod_spy hangup hook due to missing private data\n");
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        switch_thread_rwlock_wrlock(globals.spy_hash_lock);
 
        spy = switch_core_hash_find(globals.spy_hash, data);