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:
Eric Blake 2011-05-11 20:00:35 -06:00
parent 34b999be42
commit 0f9e52da82

View File

@ -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) {