Fix possibility crash

This commit is contained in:
XMRig 2017-07-02 23:35:06 +03:00
parent 72569a7fc7
commit c16388ade3

View file

@ -146,6 +146,10 @@ bool Url::setUserpass(const char *userpass)
void Url::setPassword(const char *password)
{
if (!password) {
return;
}
free(m_password);
m_password = strdup(password);
}
@ -153,6 +157,10 @@ void Url::setPassword(const char *password)
void Url::setUser(const char *user)
{
if (!user) {
return;
}
free(m_user);
m_user = strdup(user);
}