Re: [PATCH go] Fix segfault in Connect.GetMemoryStats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 23, 2017 at 01:49:59AM +0300, Matvey Kruglov wrote:
> ---
>  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(&params)), &nparams, C.uint(flags))
> +	ret = C.virNodeGetMemoryStats(c.ptr, C.int(cellNum), (*C.virNodeMemoryStats)(unsafe.Pointer(&params[0])), &nparams, C.uint(flags))
>  	if ret == -1 {
>  		return nil, GetLastError()
>  	}

FYI, I already merged the same patch you submitted a pull request for
since it was trivial and didn't require tricky review.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux