Commit e6903a19 authored by Thomas Guillem's avatar Thomas Guillem

vlc_credential: fix domain/username switch for smb

Fixes #17858
parent 52fe1919
......@@ -185,7 +185,7 @@ struct vlc_credential
vlc_keystore_entry *p_entries;
unsigned int i_entries_count;
char *psz_split_username;
char *psz_split_domain;
char *psz_var_username;
char *psz_var_password;
......
......@@ -277,11 +277,12 @@ smb_split_domain(vlc_credential *p_credential)
size_t i_len = psz_delim - p_credential->psz_username;
if (i_len > 0)
{
p_credential->psz_split_username =
free(p_credential->psz_split_domain);
p_credential->psz_split_domain =
strndup(p_credential->psz_username, i_len);
p_credential->psz_username = p_credential->psz_split_username;
p_credential->psz_realm = p_credential->psz_split_domain;
}
p_credential->psz_realm = psz_delim + 1;
p_credential->psz_username = psz_delim + 1;
}
}
......@@ -362,7 +363,7 @@ vlc_credential_clean(vlc_credential *p_credential)
if (p_credential->p_keystore)
vlc_keystore_release(p_credential->p_keystore);
free(p_credential->psz_split_username);
free(p_credential->psz_split_domain);
free(p_credential->psz_var_username);
free(p_credential->psz_var_password);
free(p_credential->psz_dialog_username);
......
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