Change char->free to auto_char char for autocleanup

Replace `gchar` and `g_free` to `auto_gchar`
Correct certain  `char` functions/variables to `gchar`

Related to #1819.

Edited by @jubalh.
This commit is contained in:
John Hernandez
2023-07-11 13:23:58 +02:00
parent 245d69deb6
commit e1d137f4e6
62 changed files with 498 additions and 969 deletions

View File

@@ -83,7 +83,7 @@ log_database_init(ProfAccount* account)
return FALSE;
}
char* filename = _get_db_filename(account);
auto_char char* filename = _get_db_filename(account);
if (!filename) {
return FALSE;
}
@@ -92,7 +92,6 @@ log_database_init(ProfAccount* account)
if (ret != SQLITE_OK) {
const char* err_msg = sqlite3_errmsg(g_chatlog_database);
log_error("Error opening SQLite database: %s", err_msg);
free(filename);
return FALSE;
}
@@ -126,7 +125,6 @@ log_database_init(ProfAccount* account)
}
log_debug("Initialized SQLite database: %s", filename);
free(filename);
return TRUE;
out:
@@ -136,7 +134,6 @@ out:
} else {
log_error("Unknown SQLite error");
}
free(filename);
return FALSE;
}