mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +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