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