forked from auracaster/openocd
log: fix memory leak when log to file is enabled
When log to file is enabled, the file is not closed by OpenOCD at exit. This is reported by Valgrind as a memory leak that is still reachable, as the internal buffers of 'FILE *log_output' are freed by the automatic fclose() at exit. Close the log file before exit. Change-Id: Id472c0d04462035254a9b49ecb0a4037263c6f6f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6789 Tested-by: jenkins
This commit is contained in:
@@ -72,6 +72,7 @@ __attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 5, 6)));
|
||||
* Initialize logging module. Call during program startup.
|
||||
*/
|
||||
void log_init(void);
|
||||
void log_exit(void);
|
||||
int set_log_output(struct command_context *cmd_ctx, FILE *output);
|
||||
|
||||
int log_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
Reference in New Issue
Block a user