mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Secure code and fix memory leak.
This commit is contained in:
parent
5b8cb64650
commit
26c21451b9
1 changed files with 7 additions and 1 deletions
|
|
@ -422,11 +422,17 @@ static void linphone_gtk_assistant_prepare(GtkWidget *assistant, GtkWidget *page
|
|||
|
||||
gchar *username = creator->username + 4;
|
||||
const gchar *needle = "@";
|
||||
username = g_strndup(username, (g_strrstr(username, needle) - username));
|
||||
const gchar *needle_ptr = g_strrstr(username, needle);
|
||||
if (needle_ptr != NULL) {
|
||||
username = g_strndup(username, needle_ptr - username);
|
||||
} else {
|
||||
username = g_strdup(username);
|
||||
}
|
||||
gchar domain[128];
|
||||
g_snprintf(domain, sizeof(domain), "\"%s\"", creator->domain + 4);
|
||||
LinphoneAuthInfo *info=linphone_auth_info_new(username, username, creator->password, NULL, domain);
|
||||
linphone_core_add_auth_info(linphone_gtk_get_core(),info);
|
||||
g_free(username);
|
||||
|
||||
if (linphone_core_add_proxy_config(linphone_gtk_get_core(),cfg)==-1)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue