mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
Fix coverity-reported leak in virSecurityManagerGenLabel
Coverity complains about a possible leak of seclabel if !sec_managers[i]->drv->domainGenSecurityLabel is true and the seclabel might be overwritten by the next iteration of the loop. This leak should never happen, because every security driver has domainGenSecurityLabel defined.
This commit is contained in:
parent
2279d5605c
commit
66050f0f89
@ -514,6 +514,8 @@ int virSecurityManagerGenLabel(virSecurityManagerPtr mgr,
|
||||
|
||||
if (!sec_managers[i]->drv->domainGenSecurityLabel) {
|
||||
virReportUnsupportedError();
|
||||
virSecurityLabelDefFree(seclabel);
|
||||
seclabel = NULL;
|
||||
} else {
|
||||
/* The seclabel must be added to @vm prior calling domainGenSecurityLabel
|
||||
* which may require seclabel to be presented already */
|
||||
|
Loading…
Reference in New Issue
Block a user