]> xenbits.xensource.com Git - libvirt.git/commitdiff
Avoid compiler warnings in virCPUDefStealModel
authorJiri Denemark <jdenemar@redhat.com>
Wed, 16 Nov 2016 07:55:30 +0000 (08:55 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 16 Nov 2016 08:04:51 +0000 (09:04 +0100)
Old GCC on CentOS 6 thinks vendor and vendor_id might be used
uninitialized in virCPUDefStealModel. The compiler is wrong, though.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/conf/cpu_conf.c

index 9eb69c9c85982c464e9f11889ce775c4cfdda699..1bcceeda4268b3f7ac7f81f2b68088f42c432e0e 100644 (file)
@@ -144,8 +144,8 @@ virCPUDefStealModel(virCPUDefPtr dst,
                     virCPUDefPtr src,
                     bool keepVendor)
 {
-    char *vendor;
-    char *vendor_id;
+    char *vendor = NULL;
+    char *vendor_id = NULL;
 
     if (keepVendor) {
         VIR_STEAL_PTR(vendor, dst->vendor);