From 933cabb53d630317472a202e8571f6d8403b3314 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 25 Feb 2011 17:53:02 -0500 Subject: [PATCH] freetdm: do not free sigmsg if was not queued fix type casting --- libs/freetdm/src/ftdm_io.c | 2 +- .../src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 947dff62e3..765a3b3431 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -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; } diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c index 85048bfbf0..bd3db2942a 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c @@ -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);