From 5005542c10ebdf6fcb4d76f31c522cc1c9136a67 Mon Sep 17 00:00:00 2001 Message-Id: <5005542c10ebdf6fcb4d76f31c522cc1c9136a67@dist-git> From: John Ferlan Date: Fri, 4 Nov 2016 10:29:45 +0100 Subject: [PATCH] conf: Remove incorrect check when encoding shmem audit message Remove the !size check since size is initialized to NULL and thus causing the condition to always be true (cherry picked from commit c951cdbff94ff577c5caa3dfff4153a161c073e6) https://bugzilla.redhat.com/show_bug.cgi?id=1389013 Signed-off-by: Martin Kletzander --- src/conf/domain_audit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index f0cc49c..be962d6 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -982,7 +982,7 @@ virDomainAuditShmem(virDomainObjPtr vm, virUUIDFormat(vm->def->uuid, uuidstr); - if (!vmname || !src || !size || !shmem || + if (!vmname || !src || !shmem || virAsprintfQuiet(&size, "%llu", def->size) < 0) { VIR_WARN("OOM while encoding audit message"); goto cleanup; @@ -996,7 +996,7 @@ virDomainAuditShmem(virDomainObjPtr vm, VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success, "virt=%s resrc=shmem reason=%s %s uuid=%s size=%s %s %s", - virt, reason, vmname, uuidstr, size ?: "?", shmem, src); + virt, reason, vmname, uuidstr, size, shmem, src); cleanup: VIR_FREE(vmname); -- 2.10.2