diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 12932bec75..27b3375420 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2638,6 +2638,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t stream->write_function(stream, "%25s\t%32s\t%s\t%6.2f\t%u/%u\t%u/%u", pkey, gp->register_to, sofia_state_names[gp->state], gp->ping_time, gp->ib_failed_calls, gp->ib_calls, gp->ob_failed_calls, gp->ob_calls); + free(pkey); if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) { time_t now = switch_epoch_time_now(NULL); @@ -4949,6 +4950,7 @@ static int notify_csta_callback(void *pArg, int argc, char **argv, char **column switch_safe_free(route_uri); sofia_glue_free_destination(dst); + free(extra_headers); free(id); free(contact); @@ -5207,6 +5209,7 @@ static void general_event_handler(switch_event_t *event) const char *csta_event = switch_event_get_header(event, "Feature-Event"); char *ct = "application/x-as-feature-event+xml"; + char *ct_m = NULL; sofia_profile_t *profile; @@ -5258,7 +5261,8 @@ static void general_event_handler(switch_event_t *event) stream.write_function(&stream, "--%s--\r\n", boundary_string); - ct = switch_mprintf("multipart/mixed; boundary=\"%s\"", boundary_string); + ct_m = switch_mprintf("multipart/mixed; boundary=\"%s\"", boundary_string); + ct = ct_m; } else { char *fwd_type = NULL; @@ -5295,6 +5299,7 @@ static void general_event_handler(switch_event_t *event) } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "missing something\n"); } + switch_safe_free(ct_m); } break; case SWITCH_EVENT_SEND_MESSAGE: diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 941668bf47..5269b720ca 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -3384,6 +3384,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) if (zstr(name) || switch_regex_match(name, "^[\\w\\.\\-\\_]+$") != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring invalid name '%s'\n", name ? name : "NULL"); + free(pkey); goto skip; } @@ -8697,9 +8698,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t home = NULL; } - if (etmp) { - switch_safe_free(etmp); - } + switch_safe_free(etmp); } diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index da09c30069..343c231a44 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1958,7 +1958,7 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * char *remote_user; char *remote_host; char *remote_uri; - char *local_user_param = ""; + char *local_user_param = NULL; char remote_display_buf[512]; char *buf_to_free = NULL; int bInternal = 0; @@ -2091,13 +2091,14 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * data, uuid, call_id, to_tag, from_tag, direction, state, - local_user, local_user, local_host, local_user_param, + local_user, local_user, local_host, switch_str_nil(local_user_param), local_user, local_host, !strcasecmp(event_status, "hold") ? "no" : "yes", remote_display_buf, remote_user, remote_host, remote_uri ); switch_core_hash_insert(h->hash, key, tmp); + switch_safe_free(local_user_param); switch_safe_free(buf_to_free); h->rowcount++;