From 2de875e4d80851ffd8c2bbdcd48fb8185df3fb20 Mon Sep 17 00:00:00 2001 From: Chao Wang Date: Mon, 28 Oct 2024 14:34:30 -0700 Subject: [PATCH] WIP --- restore/pkg/restore/restore.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/restore/pkg/restore/restore.go b/restore/pkg/restore/restore.go index b588c53a..3037a938 100644 --- a/restore/pkg/restore/restore.go +++ b/restore/pkg/restore/restore.go @@ -461,6 +461,8 @@ func (w *WorkerWriter) CreateXAttr(ino uint64, pos uint64, xattr XAttr) error { if xattrC.name == nil { return fmt.Errorf("failed to allocate xattr name") } + defer C.free(unsafe.Pointer(xattrC.name)) + copy((*[1 << 30]byte)(unsafe.Pointer(xattrC.name))[:len(xattr.Name)], []byte(xattr.Name)) xattrC.value = unsafe.Pointer(&xattr.Value[0])