Skip to content

Commit caefb7a

Browse files
committed
Fix memory leaks.
1 parent 7d8d0d2 commit caefb7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vfs.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ func (v *VFS) NumOfFragmentsInPath(path string) (int, error) {
464464
Vfs: v,
465465
}
466466
data := pointer.Save(&numOfFragmentsData)
467-
defer C.free(data)
467+
defer pointer.Unref(data)
468468

469469
ret := C._num_of_folders_in_path(v.context.tiledbContext, v.tiledbVFS, cpath, data)
470470

@@ -635,6 +635,7 @@ func (v *VFS) List(path string) ([]string, []string, error) {
635635
Vfs: v,
636636
}
637637
data := pointer.Save(&folderData)
638+
defer pointer.Unref(data)
638639

639640
ret := C._vfs_ls(v.context.tiledbContext, v.tiledbVFS, cpath, data)
640641
if ret != C.TILEDB_OK {

0 commit comments

Comments
 (0)