]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix a problem where radius channel variables were missing in mod_xml_radius
authorWilliam King <william.king@quentustech.com>
Thu, 4 Sep 2014 21:29:35 +0000 (14:29 -0700)
committerWilliam King <william.king@quentustech.com>
Thu, 4 Sep 2014 21:29:35 +0000 (14:29 -0700)
src/mod/xml_int/mod_xml_radius/mod_xml_radius.c

index 1c8a4744e5464c3f9838a37b284e566e63f33b91..8075204e777e9b4dbd2f06c78d7b6164932a307c 100644 (file)
@@ -544,7 +544,12 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch
                                                        goto err;
                                                }                       
                                        } else if ( attribute->type == 1 ) {
-                                               int number = atoi(switch_channel_get_variable(channel, variable));
+                                               char *data = switch_channel_get_variable(channel, variable);
+                                               int number = 0;
+                                               
+                                               if ( data ) {
+                                                       number = atoi(data);
+                                               }
                                                
                                                if (rc_avpair_add(handle, send, attr_num, &number, -1, vend_num) == NULL) {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,