]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1301065 fix possible NULL
authorSeven Du <dujinfang@gmail.com>
Fri, 29 May 2015 04:11:01 +0000 (12:11 +0800)
committerSeven Du <dujinfang@gmail.com>
Fri, 29 May 2015 04:11:01 +0000 (12:11 +0800)
src/mod/endpoints/mod_rtmp/rtmp_tcp.c

index c4288a4c3bc6d8c2141cd56335a581dcc37d8e01..0b7264ebcb2ad78c8ceb611e3c05b26626ea6c06 100644 (file)
@@ -225,9 +225,11 @@ void *SWITCH_THREAD_FUNC rtmp_io_tcp_thread(switch_thread_t *thread, void *obj)
 
                                                /* Get the remote address/port info */
                                                switch_socket_addr_get(&addr, SWITCH_TRUE, newsocket);
-                                               switch_get_addr(ipbuf, sizeof(ipbuf), addr);
-                                               rsession->remote_address = switch_core_strdup(rsession->pool, ipbuf);
-                                               rsession->remote_port = switch_sockaddr_get_port(addr);
+                                               if (addr) {
+                                                       switch_get_addr(ipbuf, sizeof(ipbuf), addr);
+                                                       rsession->remote_address = switch_core_strdup(rsession->pool, ipbuf);
+                                                       rsession->remote_port = switch_sockaddr_get_port(addr);
+                                               }
                                                switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_INFO, "Rtmp connection from %s:%i\n",
                                                                                  rsession->remote_address, rsession->remote_port);
                                        }