mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 10:38:05 +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();
|
current_caps = cap_get_proc();
|
||||||
if (current_caps)
|
if (current_caps)
|
||||||
|
{
|
||||||
current_caps_text = cap_to_text(current_caps, NULL);
|
current_caps_text = cap_to_text(current_caps, NULL);
|
||||||
|
cap_free(current_caps);
|
||||||
|
}
|
||||||
|
|
||||||
wanted_caps_text = cap_to_text(zprivs_state.caps, NULL);
|
wanted_caps_text = cap_to_text(zprivs_state.caps, NULL);
|
||||||
fprintf(stderr, "Wanted caps: %s\n", wanted_caps_text ? wanted_caps_text : "???");
|
fprintf(stderr, "Wanted caps: %s\n", wanted_caps_text ? wanted_caps_text : "???");
|
||||||
fprintf(stderr, "Have caps: %s\n", current_caps_text ? current_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);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user