mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 10:04:18 +00:00
Merge pull request #14773 from LabNConsulting/fix-log-vty-memleak
lib: free the log file resources created at startup and config
This commit is contained in:
commit
34445653cb
@ -857,12 +857,24 @@ void log_config_write(struct vty *vty)
|
||||
}
|
||||
}
|
||||
|
||||
static int log_vty_fini(void)
|
||||
{
|
||||
if (zt_file_cmdline.filename)
|
||||
zlog_file_fini(&zt_file_cmdline);
|
||||
if (zt_file.filename)
|
||||
zlog_file_fini(&zt_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int log_vty_init(const char *progname, const char *protoname,
|
||||
unsigned short instance, uid_t uid, gid_t gid)
|
||||
{
|
||||
zlog_progname = progname;
|
||||
zlog_protoname = protoname;
|
||||
|
||||
hook_register(zlog_fini, log_vty_fini);
|
||||
|
||||
zlog_set_prefix_ec(true);
|
||||
zlog_set_prefix_xid(true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user