fix memory leaks

This commit is contained in:
Simon Morlat 2015-09-23 16:39:18 +02:00
parent 89861d69e4
commit 6e96789f33
3 changed files with 8 additions and 4 deletions

View file

@ -1513,7 +1513,10 @@ void linphone_configuring_terminated(LinphoneCore *lc, LinphoneConfiguringState
if (linphone_core_is_provisioning_transient(lc) == TRUE)
linphone_core_set_provisioning_uri(lc, NULL);
}
if (lc->provisioning_http_listener){
belle_sip_object_unref(lc->provisioning_http_listener);
lc->provisioning_http_listener = NULL;
}
linphone_core_start(lc);
}
@ -2486,6 +2489,7 @@ void linphone_core_iterate(LinphoneCore *lc){
belle_tls_verify_policy_t *tls_policy = belle_tls_verify_policy_new();
belle_tls_verify_policy_set_root_ca(tls_policy, sal_get_root_ca(lc->sal));
belle_http_provider_set_tls_verify_policy(lc->http_provider, tls_policy);
belle_sip_object_unref(tls_policy);
}
linphone_core_notify_display_status(lc, _("Configuring"));

View file

@ -883,6 +883,7 @@ struct _LinphoneCore
#endif //BUILD_UPNP
belle_http_provider_t *http_provider;
belle_tls_verify_policy_t *http_verify_policy;
belle_http_request_listener_t *provisioning_http_listener;
MSList *tones;
LinphoneReason chat_deny_code;
char *file_transfer_server;

View file

@ -112,7 +112,6 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char
} else if( scheme && strncmp(scheme, "http", 4) == 0 && host && strlen(host) > 0) {
belle_http_request_listener_callbacks_t belle_request_listener={0};
belle_http_request_listener_t *listener;
belle_http_request_t *request;
belle_request_listener.process_response=belle_request_process_response_event;
@ -120,10 +119,10 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char
belle_request_listener.process_io_error=belle_request_process_io_error;
belle_request_listener.process_timeout=belle_request_process_timeout;
listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc);
lc->provisioning_http_listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc);
request=belle_http_request_create("GET",uri, NULL);
return belle_http_provider_send_request(lc->http_provider, request, listener);
return belle_http_provider_send_request(lc->http_provider, request, lc->provisioning_http_listener);
} else {
ms_error("Invalid provisioning URI [%s] (missing scheme or host ?)",remote_provisioning_uri);
return -1;