Fix cgo pointer param error (#27313)

Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
xige-16 2023-09-22 18:49:26 +08:00 committed by GitHub
parent 1d76565894
commit fa06265756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,11 +86,11 @@ func GetCProtoBlob(cProto *C.CProto) []byte {
func GetLocalUsedSize(path string) (int64, error) {
var availableSize int64
cSize := C.int64_t(availableSize)
cSize := (*C.int64_t)(&availableSize)
cPath := C.CString(path)
defer C.free(unsafe.Pointer(cPath))
status := C.GetLocalUsedSize(cPath, &cSize)
status := C.GetLocalUsedSize(cPath, cSize)
err := HandleCStatus(&status, "get local used size failed")
if err != nil {
return 0, err