mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
security_apparmor: fix memleaks in AppArmorSetFDLabel
proc and fd_path are allocated but never freed. Fix by using
g_autofree instead.
Fixes: b9757fea30
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
c97766a639
commit
76b9227eea
@ -1109,8 +1109,8 @@ AppArmorSetFDLabel(virSecurityManager *mgr,
|
||||
virDomainDef *def,
|
||||
int fd)
|
||||
{
|
||||
char *proc = NULL;
|
||||
char *fd_path = NULL;
|
||||
g_autofree char *proc = NULL;
|
||||
g_autofree char *fd_path = NULL;
|
||||
|
||||
virSecurityLabelDef *secdef =
|
||||
virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME);
|
||||
|
Loading…
Reference in New Issue
Block a user