Commit 4dcd0a83 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Fix populating of subject identities in graphics event

The code is mistakenly pre-allocating the array and then appending the actual
data to this array, leaving the pre-allocated elements unused.
Signed-off-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
parent e71e54c8
......@@ -329,7 +329,7 @@ func domainEventGraphicsCallback(c C.virConnectPtr, d C.virDomainPtr,
domain := &Domain{ptr: d}
connection := &Connect{ptr: c}
subjectGo := make([]DomainEventGraphicsSubjectIdentity, subject.nidentity)
subjectGo := make([]DomainEventGraphicsSubjectIdentity, 0)
nidentities := int(subject.nidentity)
identities := (*[1 << 30]C.virDomainEventGraphicsSubjectIdentity)(unsafe.Pointer(&subject.identities))[:nidentities:nidentities]
for _, identity := range identities {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment