Skip to content

Commit 46be069

Browse files
committed
close Writer after use which may leak mem
Signed-off-by: Zou Nengren <[email protected]>
1 parent 6927fc3 commit 46be069

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

content/testsuite/testsuite.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ func checkCrossNSShare(ctx context.Context, t *testing.T, cs content.Store) {
820820
if err != nil {
821821
t.Fatal(err)
822822
}
823+
defer w.Close()
823824
t2 := time.Now()
824825

825826
checkStatus(t, w, content.Status{
@@ -878,6 +879,7 @@ func checkCrossNSAppend(ctx context.Context, t *testing.T, cs content.Store) {
878879
if err != nil {
879880
t.Fatal(err)
880881
}
882+
defer w.Close()
881883
t2 := time.Now()
882884

883885
checkStatus(t, w, content.Status{
@@ -940,6 +942,7 @@ func checkCrossNSIsolate(ctx context.Context, t *testing.T, cs content.Store) {
940942
if err != nil {
941943
t.Fatal(err)
942944
}
945+
defer w.Close()
943946
t4 := time.Now()
944947

945948
checkNewlyCreated(t, w, t1, t2, t3, t4)

0 commit comments

Comments
 (0)