mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 11:25:41 +00:00
Merge pull request #7047 from qlyoung/fix-zlog-target-null-deref
lib: fix possible null dereference in zlog
This commit is contained in:
commit
000ce30ee5
@ -225,10 +225,11 @@ static bool zlog_file_cycle(struct zlog_cfg_file *zcf)
|
|||||||
zlt->zt.logfn_sigsafe = zlog_fd_sigsafe;
|
zlt->zt.logfn_sigsafe = zlog_fd_sigsafe;
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
old = zlog_target_replace(&zcf->active->zt, &zlt->zt);
|
old = zlog_target_replace(zcf->active ? &zcf->active->zt : NULL,
|
||||||
|
zlt ? &zlt->zt : NULL);
|
||||||
zcf->active = zlt;
|
zcf->active = zlt;
|
||||||
|
|
||||||
zlog_file_target_free(container_of(old, struct zlt_fd, zt));
|
zlog_file_target_free(container_of_null(old, struct zlt_fd, zt));
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user