mirror of git://git.sysmocom.de/ofono
The g_free() function checks for NULL pointers
And so does even the free() function from glibc ;)
This commit is contained in:
parent
e396b7d5af
commit
6cbfe5fa1e
|
@ -60,12 +60,10 @@ void auth_set_credentials(struct auth_data *data, const char *username,
|
|||
if (data == NULL)
|
||||
return;
|
||||
|
||||
if (data->username)
|
||||
g_free(data->username);
|
||||
if (data->passwd)
|
||||
g_free(data->passwd);
|
||||
|
||||
g_free(data->username);
|
||||
data->username = g_strdup(username);
|
||||
|
||||
g_free(data->passwd);
|
||||
data->passwd = g_strdup(passwd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue