]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3353 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 20 Jun 2011 15:32:11 +0000 (10:32 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 20 Jun 2011 15:32:11 +0000 (10:32 -0500)
src/mod/endpoints/mod_rtmp/mod_rtmp.c

index af13d31eb3c79c687e255d43c2beabf89d0a5867..99eef07057bd0b171da748aef973ff68ce39eca1 100644 (file)
@@ -1177,10 +1177,12 @@ switch_status_t rtmp_session_check_user(rtmp_session_t *rsession, const char *us
        switch_status_t status = SWITCH_STATUS_FALSE;
        
        switch_thread_rwlock_rdlock(rsession->account_rwlock);
-       for (account = rsession->account; account; account = account->next) {
-               if (!strcmp(account->user, user) && !strcmp(account->domain, domain)) {
-                       status = SWITCH_STATUS_SUCCESS;
-                       break;
+       if (user && domain) {
+               for (account = rsession->account; account; account = account->next) {
+                       if (account->user && account->domain && !strcmp(account->user, user) && !strcmp(account->domain, domain)) {
+                               status = SWITCH_STATUS_SUCCESS;
+                               break;
+                       }
                }
        }
        switch_thread_rwlock_unlock(rsession->account_rwlock);