mirror of https://gitee.com/openkylin/libvirt.git
phyp: avoid a crash
This has been present since the introduction of phypAttachDevice
in commit 444fd07a
.
* src/phyp/phyp_driver.c (phypAttachDevice): Don't dereference
NULL.
This commit is contained in:
parent
34b999be42
commit
0f9e52da82
|
@ -1720,6 +1720,11 @@ phypAttachDevice(virDomainPtr domain, const char *xml)
|
|||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
char *domain_name = NULL;
|
||||
|
||||
if (VIR_ALLOC(def) < 0) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
domain_name = escape_specialcharacters(domain->name);
|
||||
|
||||
if (domain_name == NULL) {
|
||||
|
|
Loading…
Reference in New Issue