[PATCH] conf: add missing break in virDomainAuditRedirdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Also initialize to NULL a few variables that might get
free before being set.
---
 src/conf/domain_audit.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index ef0f47a..c9c6003 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -250,8 +250,8 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *vmname;
-    char *address;
-    char *device;
+    char *address = NULL;
+    char *device = NULL;
     const char *virt;
 
     virUUIDFormat(vm->def->uuid, uuidstr);
@@ -323,8 +323,8 @@ virDomainAuditRedirdev(virDomainObjPtr vm, virDomainRedirdevDefPtr redirdev,
 {
     char uuidstr[VIR_UUID_STRING_BUFLEN];
     char *vmname;
-    char *address;
-    char *device;
+    char *address = NULL;
+    char *device = NULL;
     const char *virt;
 
     virUUIDFormat(vm->def->uuid, uuidstr);
@@ -344,6 +344,7 @@ virDomainAuditRedirdev(virDomainObjPtr vm, virDomainRedirdevDefPtr redirdev,
             VIR_WARN("OOM while encoding audit message");
             goto cleanup;
         }
+        break;
     default:
         VIR_WARN("Unexpected redirdev bus while encoding audit message: %d",
                  redirdev->bus);
-- 
1.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]