Commit 6e96789f authored by Simon Morlat's avatar Simon Morlat

fix memory leaks

parent 89861d69
......@@ -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"));
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment