removing possible memory leaks from why2_init_logger
This commit is contained in:
parent
109ec9a7b6
commit
55dacb2a84
@ -77,7 +77,7 @@ why2_log_file why2_init_logger(char *directoryPath)
|
||||
|
||||
sprintf(filePath, WHY2_LOG_FORMATTING, directoryPath, dateBuffer, buffer); //GENERATE LOG-NAME
|
||||
|
||||
file = why2_open(filePath, O_RDWR | O_APPEND | O_CREAT, 0644); //CREATE LOG FILE
|
||||
file = open(filePath, O_RDWR | O_APPEND | O_CREAT, 0644); //CREATE LOG FILE
|
||||
|
||||
//CREATE SYMLINK
|
||||
sprintf(latestBuffer, WHY2_LOG_LATEST_FORMATTING, WHY2_WRITE_DIR, WHY2_LOG_LATEST); //GENERATE LATEST.log PATH
|
||||
@ -90,6 +90,7 @@ why2_log_file why2_init_logger(char *directoryPath)
|
||||
{
|
||||
if (!why2_get_flags().no_output) fprintf(stderr, "Creating symlink failed!\n");
|
||||
|
||||
close(file);
|
||||
why2_clean_memory("logger_logfile_init");
|
||||
return why2_empty_log_file();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user