Signed-off-by: Tim Small <t...@seoss.co.uk>
---
 src/security/virt-aa-helper.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index e3802c18be..fa69245324 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -1134,10 +1134,9 @@ get_files(vahControl * ctl)
     }
 
     for (i = 0; i < ctl->def->nnets; i++) {
-        if (ctl->def->nets[i] &&
-                ctl->def->nets[i]->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER &&
-                ctl->def->nets[i]->data.vhostuser) {
-            virDomainChrSourceDef *vhu = ctl->def->nets[i]->data.vhostuser;
+        virDomainNetDef *net = ctl->def->nets[i];
+        if (net && net->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER && 
net->data.vhostuser) {
+            virDomainChrSourceDef *vhu = net->data.vhostuser;
 
             if (vah_add_file_chardev(&buf, vhu->data.nix.path, "rw",
                        vhu->type) != 0)
-- 
2.47.2

Reply via email to