freetdm: do not free sigmsg if was not queued
fix type casting
This commit is contained in:
parent
244e7c7610
commit
933cabb53d
|
@ -5296,7 +5296,6 @@ FT_DECLARE(ftdm_status_t) ftdm_group_create(ftdm_group_t **group, const char *na
|
||||||
static ftdm_status_t ftdm_span_trigger_signal(const ftdm_span_t *span, ftdm_sigmsg_t *sigmsg)
|
static ftdm_status_t ftdm_span_trigger_signal(const ftdm_span_t *span, ftdm_sigmsg_t *sigmsg)
|
||||||
{
|
{
|
||||||
ftdm_status_t status = span->signal_cb(sigmsg);
|
ftdm_status_t status = span->signal_cb(sigmsg);
|
||||||
ftdm_sigmsg_free(&sigmsg);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5319,6 +5318,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_trigger_signals(const ftdm_span_t *span)
|
||||||
ftdm_sigmsg_t *sigmsg = NULL;
|
ftdm_sigmsg_t *sigmsg = NULL;
|
||||||
while ((sigmsg = ftdm_queue_dequeue(span->pendingsignals))) {
|
while ((sigmsg = ftdm_queue_dequeue(span->pendingsignals))) {
|
||||||
ftdm_span_trigger_signal(span, sigmsg);
|
ftdm_span_trigger_signal(span, sigmsg);
|
||||||
|
ftdm_sigmsg_free(&sigmsg);
|
||||||
}
|
}
|
||||||
return FTDM_SUCCESS;
|
return FTDM_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -722,8 +722,10 @@ ftdm_status_t set_facility_ie_str(ftdm_channel_t *ftdmchan, uint8_t *data, uint8
|
||||||
{
|
{
|
||||||
ftdm_size_t len;
|
ftdm_size_t len;
|
||||||
uint8_t *mydata;
|
uint8_t *mydata;
|
||||||
|
void *vdata;
|
||||||
|
|
||||||
if (ftdm_usrmsg_get_raw_data(ftdmchan->usrmsg, (void**)&mydata, &len) == FTDM_SUCCESS) {
|
if (ftdm_usrmsg_get_raw_data(ftdmchan->usrmsg, &vdata, &len) == FTDM_SUCCESS) {
|
||||||
|
mydata = vdata;
|
||||||
if (len > 2 && mydata[0] == SNGISDN_Q931_FACILITY_IE_ID) {
|
if (len > 2 && mydata[0] == SNGISDN_Q931_FACILITY_IE_ID) {
|
||||||
len = mydata[1];
|
len = mydata[1];
|
||||||
memcpy(data, &mydata[2], len);
|
memcpy(data, &mydata[2], len);
|
||||||
|
|
Loading…
Reference in New Issue