mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-26 20:08:34 +00:00
fix(proxy): avoid memory leak
This commit is contained in:
parent
1f46a5677f
commit
f03164f2f7
2 changed files with 6 additions and 8 deletions
|
|
@ -425,8 +425,6 @@ void linphone_proxy_config_stop_refreshing(LinphoneProxyConfig * cfg){
|
||||||
/*with udp, there is a risk of port reuse, so I prefer to not do anything for now*/
|
/*with udp, there is a risk of port reuse, so I prefer to not do anything for now*/
|
||||||
if (contact_addr) {
|
if (contact_addr) {
|
||||||
if (linphone_address_get_transport(contact_addr) != LinphoneTransportUdp) {
|
if (linphone_address_get_transport(contact_addr) != LinphoneTransportUdp) {
|
||||||
/*need to save current contact in order to reset is later*/
|
|
||||||
linphone_address_ref(contact_addr);
|
|
||||||
if (cfg->pending_contact)
|
if (cfg->pending_contact)
|
||||||
linphone_address_unref(cfg->pending_contact);
|
linphone_address_unref(cfg->pending_contact);
|
||||||
cfg->pending_contact=contact_addr;
|
cfg->pending_contact=contact_addr;
|
||||||
|
|
|
||||||
|
|
@ -612,7 +612,7 @@ static void transport_dont_bind(void){
|
||||||
LinphoneTransports *tr = linphone_transports_new();
|
LinphoneTransports *tr = linphone_transports_new();
|
||||||
linphone_transports_set_tcp_port(tr, LC_SIP_TRANSPORT_DONTBIND);
|
linphone_transports_set_tcp_port(tr, LC_SIP_TRANSPORT_DONTBIND);
|
||||||
linphone_transports_set_tls_port(tr, LC_SIP_TRANSPORT_DONTBIND);
|
linphone_transports_set_tls_port(tr, LC_SIP_TRANSPORT_DONTBIND);
|
||||||
|
|
||||||
linphone_core_set_transports(pauline->lc, tr);
|
linphone_core_set_transports(pauline->lc, tr);
|
||||||
BC_ASSERT_TRUE(wait_for_until(pauline->lc,pauline->lc,&counters->number_of_LinphoneRegistrationOk,2,15000));
|
BC_ASSERT_TRUE(wait_for_until(pauline->lc,pauline->lc,&counters->number_of_LinphoneRegistrationOk,2,15000));
|
||||||
linphone_transports_unref(tr);
|
linphone_transports_unref(tr);
|
||||||
|
|
@ -627,14 +627,14 @@ static void transport_dont_bind(void){
|
||||||
static void transport_busy(void){
|
static void transport_busy(void){
|
||||||
LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_tcp_rc");
|
LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_tcp_rc");
|
||||||
LCSipTransports tr;
|
LCSipTransports tr;
|
||||||
|
|
||||||
memset(&tr, 0, sizeof(tr));
|
memset(&tr, 0, sizeof(tr));
|
||||||
tr.udp_port = 5070;
|
tr.udp_port = 5070;
|
||||||
tr.tcp_port = 5070;
|
tr.tcp_port = 5070;
|
||||||
tr.tls_port = 5071;
|
tr.tls_port = 5071;
|
||||||
|
|
||||||
linphone_core_set_sip_transports(pauline->lc, &tr);
|
linphone_core_set_sip_transports(pauline->lc, &tr);
|
||||||
|
|
||||||
{
|
{
|
||||||
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
|
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
|
||||||
linphone_core_set_sip_transports(marie->lc, &tr);
|
linphone_core_set_sip_transports(marie->lc, &tr);
|
||||||
|
|
@ -645,7 +645,7 @@ static void transport_busy(void){
|
||||||
BC_ASSERT_EQUAL(tr.tls_port, 0, int, "%i");*/
|
BC_ASSERT_EQUAL(tr.tls_port, 0, int, "%i");*/
|
||||||
linphone_core_manager_destroy(marie);
|
linphone_core_manager_destroy(marie);
|
||||||
}
|
}
|
||||||
|
|
||||||
linphone_core_manager_destroy(pauline);
|
linphone_core_manager_destroy(pauline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -914,7 +914,7 @@ char *read_file(const char *path) {
|
||||||
size_t readbytes;
|
size_t readbytes;
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
FILE *infile = fopen(path, "rb");
|
FILE *infile = fopen(path, "rb");
|
||||||
|
|
||||||
BC_ASSERT_PTR_NOT_NULL(infile);
|
BC_ASSERT_PTR_NOT_NULL(infile);
|
||||||
if (infile) {
|
if (infile) {
|
||||||
fseek(infile, 0L, SEEK_END);
|
fseek(infile, 0L, SEEK_END);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue