]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add error checking
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 24 Jun 2010 15:02:55 +0000 (10:02 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 24 Jun 2010 15:02:55 +0000 (10:02 -0500)
libs/esl/ivrd.c

index ed045f31d0449a3e6c079cc1b67511ed8878414d..842ef6be1399def9af8fe78a7eed86c7d506d628 100644 (file)
@@ -47,8 +47,10 @@ static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struc
                return;
        }
        
-
-       esl_attach_handle(&handle, client_sock, addr);
+       if (esl_attach_handle(&handle, client_sock, addr) != ESL_SUCCESS || !handle.info_event) {
+               esl_log(ESL_LOG_ERROR, "Socket Error\n");
+               exit(0);
+       }
 
        if (!(path = esl_event_get_header(handle.info_event, "variable_ivr_path"))) {
                esl_disconnect(&handle);