mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 15:17:15 +00:00
lib: fix memory leak in zprivs_caps_init
This commit is contained in:
parent
0ef4bcdca0
commit
7c101d199e
@ -307,11 +307,18 @@ zprivs_caps_init (struct zebra_privs_t *zprivs)
|
||||
|
||||
current_caps = cap_get_proc();
|
||||
if (current_caps)
|
||||
{
|
||||
current_caps_text = cap_to_text(current_caps, NULL);
|
||||
cap_free(current_caps);
|
||||
}
|
||||
|
||||
wanted_caps_text = cap_to_text(zprivs_state.caps, NULL);
|
||||
fprintf(stderr, "Wanted caps: %s\n", wanted_caps_text ? wanted_caps_text : "???");
|
||||
fprintf(stderr, "Have caps: %s\n", current_caps_text ? current_caps_text : "???");
|
||||
if (current_caps_text)
|
||||
cap_free(current_caps_text);
|
||||
if (wanted_caps_text)
|
||||
cap_free(wanted_caps_text);
|
||||
|
||||
exit (1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user