freetdm: do not free sigmsg if was not queued

fix type casting
This commit is contained in:
Moises Silva 2011-02-25 17:53:02 -05:00
parent 244e7c7610
commit 933cabb53d
2 changed files with 4 additions and 2 deletions

View File

@ -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)
{
ftdm_status_t status = span->signal_cb(sigmsg);
ftdm_sigmsg_free(&sigmsg);
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;
while ((sigmsg = ftdm_queue_dequeue(span->pendingsignals))) {
ftdm_span_trigger_signal(span, sigmsg);
ftdm_sigmsg_free(&sigmsg);
}
return FTDM_SUCCESS;
}

View File

@ -722,8 +722,10 @@ ftdm_status_t set_facility_ie_str(ftdm_channel_t *ftdmchan, uint8_t *data, uint8
{
ftdm_size_t len;
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) {
len = mydata[1];
memcpy(data, &mydata[2], len);