mirror of https://gitee.com/openkylin/libvirt.git
selinux: fix NULL dereference in GetSecurityMountOptions
In the case of an OOM error in virDomainDefGetSecurityLabelDef, secdef is set to NULL, then dereferenced while printing the debug message.
This commit is contained in:
parent
912a4e9c06
commit
b28fb61fd7
|
@ -1993,7 +1993,8 @@ virSecuritySELinuxGetSecurityMountOptions(virSecurityManagerPtr mgr,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
VIR_DEBUG("imageLabel=%s opts=%s", secdef->imagelabel, opts);
|
||||
VIR_DEBUG("imageLabel=%s opts=%s",
|
||||
secdef ? secdef->imagelabel : "(null)", opts);
|
||||
return opts;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue