[libvirt] [PATCH go] Fix segfault in Connect.GetMemoryStats
Matvey Kruglov
kubuzzzz at gmail.com
Sun Jan 22 22:49:59 UTC 2017
---
connect.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/connect.go b/connect.go
index 35eb7fd..6730171 100644
--- a/connect.go
+++ b/connect.go
@@ -1688,7 +1688,7 @@ func (c *Connect) GetMemoryStats(cellNum int, flags uint32) (*NodeMemoryStats, e
}
params := make([]C.virNodeMemoryStats, nparams)
- ret = C.virNodeGetMemoryStats(c.ptr, C.int(cellNum), (*C.virNodeMemoryStats)(unsafe.Pointer(¶ms)), &nparams, C.uint(flags))
+ ret = C.virNodeGetMemoryStats(c.ptr, C.int(cellNum), (*C.virNodeMemoryStats)(unsafe.Pointer(¶ms[0])), &nparams, C.uint(flags))
if ret == -1 {
return nil, GetLastError()
}
--
2.7.4
More information about the libvir-list
mailing list