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:
Ján Tomko 2012-12-13 11:44:37 +01:00 committed by Eric Blake
parent 912a4e9c06
commit b28fb61fd7

View File

@ -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;
}