[libvirt] [PATCH 2/4] storage: rbd: actually index the array when iterating over it

Ján Tomko jtomko at redhat.com
Fri Jul 12 14:26:06 UTC 2019


https://bugzilla.redhat.com/show_bug.cgi?id=1729292

Fixes: 3aa190f2a43a632b542a6ba751a6c3ab4d51f1dd
Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/storage/storage_backend_rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index d3056287df..1cb447c55a 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -637,7 +637,7 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr)
     nnames = nimages;
 
     for (i = 0; i < nimages; i++)
-        VIR_STEAL_PTR(names[i], images->name);
+        VIR_STEAL_PTR(names[i], images[i]->name);
 
     return names;
 
-- 
2.20.1




More information about the libvir-list mailing list