[libvirt] [PATCH 03/18] cpu: Add NULL check in ppc64ModelCopy()

Andrea Bolognani abologna at redhat.com
Tue Aug 4 09:37:54 UTC 2015


---
 src/cpu/cpu_ppc64.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 05ff8f2..dd02a3f 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -115,6 +115,9 @@ ppc64ModelCopy(const struct ppc64_model *model)
 {
     struct ppc64_model *copy;
 
+    if (!model)
+        return NULL;
+
     if (VIR_ALLOC(copy) < 0 ||
         VIR_STRDUP(copy->name, model->name) < 0) {
         ppc64ModelFree(copy);
-- 
2.4.3




More information about the libvir-list mailing list