From dd428d47982c4ffdafd08a0a2606e415186c8b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 14 Sep 2011 22:02:30 +0200 Subject: [PATCH] conf: add missing break in virDomainAuditRedirdev Also initialize to NULL a few variables that might get free before being set. --- src/conf/domain_audit.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index 3d079bd840..581be7046d 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -246,8 +246,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); @@ -319,8 +319,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); @@ -340,6 +340,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); -- GitLab