mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-17 16:27:44 +00:00
Fix possibility crash
This commit is contained in:
parent
72569a7fc7
commit
c16388ade3
1 changed files with 8 additions and 0 deletions
|
@ -146,6 +146,10 @@ bool Url::setUserpass(const char *userpass)
|
||||||
|
|
||||||
void Url::setPassword(const char *password)
|
void Url::setPassword(const char *password)
|
||||||
{
|
{
|
||||||
|
if (!password) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
free(m_password);
|
free(m_password);
|
||||||
m_password = strdup(password);
|
m_password = strdup(password);
|
||||||
}
|
}
|
||||||
|
@ -153,6 +157,10 @@ void Url::setPassword(const char *password)
|
||||||
|
|
||||||
void Url::setUser(const char *user)
|
void Url::setUser(const char *user)
|
||||||
{
|
{
|
||||||
|
if (!user) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
free(m_user);
|
free(m_user);
|
||||||
m_user = strdup(user);
|
m_user = strdup(user);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue