mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 04:56:21 +00:00
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:
@@ -73,9 +73,9 @@ enum {
|
||||
static void
|
||||
_rotate_log_file(void)
|
||||
{
|
||||
gchar* log_file = g_strdup(mainlogfile);
|
||||
auto_gchar gchar* log_file = g_strdup(mainlogfile);
|
||||
size_t len = strlen(log_file);
|
||||
gchar* log_file_new = malloc(len + 5);
|
||||
auto_gchar gchar* log_file_new = malloc(len + 5);
|
||||
|
||||
// the mainlog file should always end in '.log', lets remove this last part
|
||||
// so that we can have profanity.001.log later
|
||||
@@ -100,8 +100,6 @@ _rotate_log_file(void)
|
||||
|
||||
log_init(log_get_filter(), NULL);
|
||||
|
||||
free(log_file_new);
|
||||
free(log_file);
|
||||
log_info("Log has been rotated");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user