mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
accounts: get rid of guard around free
This commit is contained in:
parent
ba414eb0ac
commit
9bd635d7e6
@ -908,9 +908,7 @@ accounts_get_last_presence(const char* const account_name)
|
|||||||
result = RESOURCE_ONLINE;
|
result = RESOURCE_ONLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setting) {
|
|
||||||
g_free(setting);
|
g_free(setting);
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -939,14 +937,11 @@ accounts_get_login_presence(const char* const account_name)
|
|||||||
} else if (strcmp(setting, "last") == 0) {
|
} else if (strcmp(setting, "last") == 0) {
|
||||||
result = accounts_get_last_presence(account_name);
|
result = accounts_get_last_presence(account_name);
|
||||||
} else {
|
} else {
|
||||||
log_warning("Error reading presence.login for account: '%s', value: '%s', defaulting to 'online'",
|
log_warning("Error reading presence.login for account: '%s', value: '%s', defaulting to 'online'", account_name, setting);
|
||||||
account_name, setting);
|
|
||||||
result = RESOURCE_ONLINE;
|
result = RESOURCE_ONLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setting) {
|
|
||||||
g_free(setting);
|
g_free(setting);
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -955,13 +950,12 @@ accounts_get_login_status(const char* const account_name)
|
|||||||
{
|
{
|
||||||
gchar* setting = g_key_file_get_string(accounts, account_name, "presence.login", NULL);
|
gchar* setting = g_key_file_get_string(accounts, account_name, "presence.login", NULL);
|
||||||
gchar* status = NULL;
|
gchar* status = NULL;
|
||||||
|
|
||||||
if (g_strcmp0(setting, "last") == 0) {
|
if (g_strcmp0(setting, "last") == 0) {
|
||||||
status = accounts_get_last_status(account_name);
|
status = accounts_get_last_status(account_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setting) {
|
|
||||||
g_free(setting);
|
g_free(setting);
|
||||||
}
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user