res_pjsip, res_pjsip_session: initialize local variables

This patch initializes a couple of local variables to some default values.
Interestingly, in the 'pj_status_t dlg_status' case the value not being
initialized caused memory to grow, and not be recovered, in the off nominal
path (at least on my machine).

Change-Id: I22ee65e1e1bff8efacea8a167c6c8428898523f7
This commit is contained in:
Kevin Harwell 2020-10-19 15:31:14 -05:00 committed by George Joseph
parent f89531cb98
commit 439f7bb848
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ static void keepalive_transport_send_keepalive(struct monitored_transport *monit
static void *keepalive_transport_thread(void *data)
{
struct ao2_container *transports;
pj_thread_desc desc;
pj_thread_desc desc = { 0 };
pj_thread_t *thread;
if (pj_thread_register("Asterisk Keepalive Thread", desc, &thread) != PJ_SUCCESS) {

View File

@ -3747,7 +3747,7 @@ static pjsip_inv_session *pre_session_setup(pjsip_rx_data *rdata, const struct a
pjsip_dialog *dlg;
pjsip_inv_session *inv_session;
unsigned int options = endpoint->extensions.flags;
pj_status_t dlg_status;
pj_status_t dlg_status = PJ_EUNKNOWN;
if (pjsip_inv_verify_request(rdata, &options, NULL, NULL, ast_sip_get_pjsip_endpoint(), &tdata) != PJ_SUCCESS) {
if (tdata) {