Avoid using memory after we free it
Without setting errmsg to NULL here, we'll try to print this freed value again below if another error doesn't intercede.
This commit is contained in:
parent
d7b139f3b4
commit
3c8db7c715
|
@ -1676,7 +1676,7 @@ static uint32_t do_trans(switch_sql_queue_manager_t *qm)
|
|||
switch_cache_db_execute_sql_real(qm->event_db, qm->pre_trans_execute, &errmsg);
|
||||
if (errmsg) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL PRE TRANS EXEC %s [%s]\n", qm->pre_trans_execute, errmsg);
|
||||
free(errmsg);
|
||||
free(errmsg); errmsg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue