]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core, modules] Fix various dead assignments.
authorAndrey Volk <andywolk@gmail.com>
Mon, 25 May 2026 20:56:13 +0000 (23:56 +0300)
committerGitHub <noreply@github.com>
Mon, 25 May 2026 20:56:13 +0000 (23:56 +0300)
15 files changed:
src/mod/applications/mod_commands/mod_commands.c
src/mod/applications/mod_conference/mod_conference.c
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_presence.c
src/mod/endpoints/mod_verto/mod_verto.c
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
src/mod/formats/mod_shout/mod_shout.c
src/mod/languages/mod_python3/freeswitch_python.cpp
src/mod/languages/mod_v8/mod_v8.cpp
src/switch_core_media.c
src/switch_msrp.c
src/switch_rtp.c

index 75b79b2ebf24b1ca1d510ea783f9e1aa57734e49..22e25ea8a67531c19578ef9fa459a708ed60d60b 100644 (file)
@@ -549,7 +549,7 @@ SWITCH_STANDARD_API(reg_url_function)
        char *domain = NULL, *dup_domain = NULL;
        char *concat = NULL;
        const char *exclude_contact = NULL;
-       char *reply = "error/facility_not_subscribed";
+       char *reply;
        switch_stream_handle_t mystream = { 0 };
 
        if (!cmd) {
@@ -2324,7 +2324,7 @@ SWITCH_STANDARD_API(status_function)
        int sps = 0, last_sps = 0, max_sps = 0, max_sps_fivemin = 0;
        int sessions_peak = 0, sessions_peak_fivemin = 0; /* Max Concurrent Sessions buffers */
        switch_bool_t html = SWITCH_FALSE;      /* shortcut to format.html      */
-       char * nl = "\n";                                       /* shortcut to format.nl        */
+       char *nl;                                               /* shortcut to format.nl        */
        stream_format format = { 0 };
        switch_size_t cur = 0, max = 0;
 
@@ -7523,7 +7523,7 @@ SWITCH_STANDARD_JSON_API(json_status_function)
 SWITCH_STANDARD_API(json_function)
 {
        cJSON *jcmd = NULL, *format = NULL;
-       const char *message = "";
+       const char *message;
        char *response = NULL;
 
        if (zstr(cmd)) {
index aa606170d5e7bb58254c04770b1b51fab1691eb4..4f0374263d863017870981103481c76e88949fb2 100644 (file)
@@ -1911,8 +1911,8 @@ SWITCH_STANDARD_APP(conference_function)
        member_flag_t mflags[MFLAG_MAX] = { 0 };
        switch_core_session_message_t msg = { 0 };
        uint8_t isbr = 0;
-       char *dpin = "";
-       const char *mdpin = "";
+       char *dpin;
+       const char *mdpin;
        conference_xml_cfg_t xml_cfg = { 0 };
        switch_event_t *params = NULL;
        int locked = 0;
index 8c8d0103c449301b4f3eb751fc3587a42567711a..0767315c92b02213010763a2419828d9092ce157 100644 (file)
@@ -562,7 +562,7 @@ static void phase_e_handler(void *user_data, int result)
        switch_event_t *event;
        const char *var;
        char *expanded;
-       const char *fax_result_str = "";
+       const char *fax_result_str;
 
        pvt = (pvt_t *) user_data;
        switch_assert(pvt);
index 086d6dd088552b5a200c3781c9cfd4c6f7926619..4fd5d57c1fec776a599325838d021f8f9f3f7df1 100644 (file)
@@ -4091,7 +4091,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
        sofia_profile_t *profile = NULL;
        const char *exclude_contact = NULL;
        const char *match_user_agent = NULL;
-       char *reply = "error/facility_not_subscribed";
+       char *reply;
        switch_stream_handle_t mystream = { 0 };
 
        if (!cmd) {
index d2e94f16ceb98b9263185e2acb0a8fcf33e67e80..2901ffdd639beaea8f86f725226dbb25fb316952 100644 (file)
@@ -1210,7 +1210,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
        switch_channel_t *channel = switch_core_session_get_channel(session);
        sip_p_asserted_identity_t *passerted = NULL;
        char *name = NULL;
-       const char *number = "unknown", *tmp;
+       const char *number, *tmp;
        switch_caller_profile_t *caller_profile;
        char *dup = NULL;
        switch_event_t *event;
@@ -7535,7 +7535,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
        }
 
        if (channel && profile->pres_type && ss_state == nua_callstate_ready && status == 200) {
-               const char* to_tag = "";
+               const char* to_tag;
                char *sql = NULL;
                to_tag = switch_str_nil(switch_channel_get_variable(channel, "sip_to_tag"));
                sql = switch_mprintf("update sip_dialogs set sip_to_tag='%q' "
@@ -10392,7 +10392,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
        nua_handle_t *bnh = NULL;
        char sip_acl_authed_by[512] = "";
        char sip_acl_token[512] = "";
-       const char *dialog_from_user = "", *dialog_from_host = "", *to_user = "", *to_host = "", *contact_user = "", *contact_host = "";
+       const char *dialog_from_user = "", *dialog_from_host = "", *to_user = "", *to_host = "", *contact_user, *contact_host;
        const char *user_agent = "", *call_id = "";
        url_t *from = NULL, *to = NULL, *contact = NULL;
        const char *to_tag = "";
@@ -11635,7 +11635,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
        if (profile->pres_type) {
                const char *presence_data = switch_channel_get_variable(channel, "presence_data");
                const char *presence_id = switch_channel_get_variable(channel, "presence_id");
-               char *full_contact = "";
+               char *full_contact;
                char *p = NULL;
                time_t now;
 
index 33904aaac462ce3e8663cba65423d2252cf06321..d490ebd65c2c14c5d4c1cbb0f616ca014de209d3 100644 (file)
@@ -1038,7 +1038,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
        switch_caller_profile_t *caller_profile;
        const char *cid_name, *cid_num;
        char *e_dest = NULL;
-       const char *holdstr = "";
+       const char *holdstr;
        char *extra_headers = NULL;
        switch_status_t status = SWITCH_STATUS_FALSE;
        uint32_t session_timeout = tech_pvt->profile->session_timeout;
@@ -3334,7 +3334,7 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua
        const char *contact_host;//, *contact_user;
        sip_contact_t const *contact;
        char *port;
-       const char *display = "\"user\"";
+       const char *display;
        char new_port[25] = "";
        sofia_nat_parse_t lnp = { { 0 } };
        const char *ipv6;
index 151d6ec634e90057d010f723e49d13f571bf0979..6108cc5a6aeb2398c9288ce79b3a8d5d6ee1d0f8 100644 (file)
@@ -2392,7 +2392,7 @@ static int sofia_dialog_probe_notify_callback(void *pArg, int argc, char **argv,
        switch_stream_handle_t stream = { 0 };
        char *to;
        const char *pl = NULL;
-       const char *ct = "application/dialog-info+xml";
+       const char *ct;
 
        if (mod_sofia_globals.debug_presence > 0) {
                int i;
@@ -3659,7 +3659,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
        char *orig_proto = "";
        char *alt_proto = NULL;
        char *d_user = NULL;
-       char *contact_str = "";
+       char *contact_str;
        const char *call_id = NULL;
        char *to_str = NULL;
        char *full_from = NULL;
index 40bb51171ab8fbf9e5c755a913622c3b88b27d25..1363416139ff8315b06f6f1c64056de0d7121a88 100644 (file)
@@ -174,7 +174,7 @@ void verto_broadcast(const char *event_channel, cJSON *json, const char *key, sw
 
 static int verto_init_ssl(verto_profile_t *profile)
 {
-       const char *err = "";
+       const char *err;
        int i = 0;
 
        profile->ssl_method = SSLv23_server_method();   /* create server instance */
index 1c35b6f0493049defa199f3dcd53a3342b1359f5..31bac3305bf6263dd5843109ab6fa446e4bf45e7 100644 (file)
@@ -1117,7 +1117,7 @@ SWITCH_STANDARD_API(event_sink_function)
                }
 
                if (listener->format == EVENT_FORMAT_JSON) {
-                       char *p = "{}";
+                       char *p;
                        cJSON_AddItemToObject(cj, "events", cjevents);
                        p = cJSON_Print(cj);
                        if (cj && p) stream->write_function(stream, p);
index d6cad23bbd25dea376ed38f8aca26810d9cedfc4..5cc54a4f1a984c91be5bd600e443140e9dab6623 100644 (file)
@@ -1289,7 +1289,7 @@ void do_telecast(switch_stream_handle_t *stream)
        char *path_info = switch_event_get_header(stream->param_event, "http-path-info");
        char *uuid = strdup(path_info + 4);
        switch_core_session_t *tsession;
-       char *fname = "stream.mp3";
+       char *fname;
 
        switch_assert(uuid);
        if ((fname = strchr(uuid, '/'))) {
index e35c7ed464b33348a028056964804b43688e6358..600d8f87dfa56dca5168a8a9d88b53516161d869 100644 (file)
@@ -293,7 +293,7 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
 
        PyObject *pyresult, *arglist, *io = NULL;
        int ts = 0;
-       char *str = NULL, *what = (char*)"";
+       char *str = NULL, *what;
 
        if (TS) {
                ts++;
index b297fa39e1fd9e23542fbcad59e95f2b1ac4aed5..96ac67f2f64513a061554d35384c75bb09a37e93 100644 (file)
@@ -424,7 +424,7 @@ static void v8_error(Isolate* isolate, TryCatch* try_catch)
        String::Utf8Value exception(try_catch->Exception());
        const char *exception_string = js_safe_str(*exception);
        Handle<Message> message = try_catch->Message();
-       const char *msg = "";
+       const char *msg;
        string filename = __FILE__;
        int line = __LINE__;
        string text = "";
index de5d0eff74c395eb39fa2315e3332d0d144abd1e..51a4d3260483467f95fdcfcace3cf664dc4cab73 100644 (file)
@@ -4549,7 +4549,7 @@ static void restore_pmaps(switch_rtp_engine_t *engine)
 
 static const char *media_flow_varname(switch_media_type_t type)
 {
-       const char *varname = "invalid";
+       const char *varname;
 
        switch(type) {
        case SWITCH_MEDIA_TYPE_AUDIO:
@@ -4561,6 +4561,9 @@ static const char *media_flow_varname(switch_media_type_t type)
        case SWITCH_MEDIA_TYPE_TEXT:
                varname = "text_media_flow";
                break;
+       default:
+               varname = "invalid";
+               break;
        }
 
        return varname;
@@ -4568,7 +4571,7 @@ static const char *media_flow_varname(switch_media_type_t type)
 
 static const char *remote_media_flow_varname(switch_media_type_t type)
 {
-       const char *varname = "invalid";
+       const char *varname;
 
        switch(type) {
        case SWITCH_MEDIA_TYPE_AUDIO:
@@ -4580,6 +4583,9 @@ static const char *remote_media_flow_varname(switch_media_type_t type)
        case SWITCH_MEDIA_TYPE_TEXT:
                varname = "remote_text_media_flow";
                break;
+       default:
+               varname = "invalid";
+               break;
        }
 
        return varname;
@@ -4587,7 +4593,7 @@ static const char *remote_media_flow_varname(switch_media_type_t type)
 
 static void media_flow_get_mode(switch_media_flow_t smode, const char **mode_str, switch_media_flow_t *opp_mode)
 {
-       const char *smode_str = "";
+       const char *smode_str;
        switch_media_flow_t opp_smode = smode;
 
        switch(smode) {
@@ -4608,6 +4614,9 @@ static void media_flow_get_mode(switch_media_flow_t smode, const char **mode_str
        case SWITCH_MEDIA_FLOW_SENDRECV:
                smode_str = "sendrecv";
                break;
+       default:
+               smode_str = "";
+               break;
        }
 
        *mode_str = smode_str;
@@ -11775,7 +11784,7 @@ SWITCH_DECLARE(void) switch_core_media_set_udptl_image_sdp(switch_core_session_t
        char max_data[128] = "";
        const char *ip;
        uint32_t port;
-       const char *family = "IP4";
+       const char *family;
        const char *username;
        const char *bit_removal_on = "a=T38FaxFillBitRemoval\r\n";
        const char *bit_removal_off = "";
@@ -12033,7 +12042,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                        switch_size_t len;
 
                        if (oe) {
-                               const char *family = "IP4";
+                               const char *family;
                                char o_line[1024] = "";
 
                                if (oe >= pe) {
index 9fd84d846b738a142851ab15a0a27336f5b10f2e..89b2a886c6e680e1bce92d48df66a68978318e16 100644 (file)
@@ -114,7 +114,7 @@ static void msrp_deinit_ssl(void)
 
 static void msrp_init_ssl(void)
 {
-       const char *err = "";
+       const char *err;
 
        globals.ssl_client_method = SSLv23_client_method();
        globals.ssl_client_ctx = SSL_CTX_new(globals.ssl_client_method);
index d038566d90b4861809875d1a273fb096e96779e9..d92b23001e5ae68de1c2296caf4786bbb44e8af7 100644 (file)
@@ -3822,7 +3822,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, d
        switch_dtls_t *dtls;
        const char *var;
        int ret;
-       const char *kind = "";
+       const char *kind;
        unsigned long ssl_method_error = 0;
        unsigned long ssl_ctx_error = 0;
        const SSL_METHOD *ssl_method;