From 0f9e52da82fadfc848f081428856c504e55220b4 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 11 May 2011 20:00:35 -0600 Subject: [PATCH] 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. --- src/phyp/phyp_driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index cc9ace3439..8b6fa69d93 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -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) { -- 2.39.5