Skip to content

Commit 1c88921

Browse files
authored
Use malloc free when allocating with malloc (#258)
1 parent 383a038 commit 1c88921

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkgs/io_file/lib/src/vm_posix_file_system.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,13 @@ final class PosixFileSystem extends FileSystem {
553553
case 0:
554554
return buffer.asTypedList(
555555
bufferOffset,
556-
finalizer: ffi.calloc.nativeFree,
556+
finalizer: ffi.malloc.nativeFree,
557557
);
558558
default:
559559
bufferOffset += r;
560560
}
561561
}
562-
return buffer.asTypedList(length, finalizer: ffi.calloc.nativeFree);
562+
return buffer.asTypedList(length, finalizer: ffi.malloc.nativeFree);
563563
} on Exception {
564564
ffi.malloc.free(buffer);
565565
rethrow;

0 commit comments

Comments
 (0)