Skip to content

Commit 8f5b927

Browse files
Try to fix oss-fuzz low memory limit again
1 parent 96b2369 commit 8f5b927

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fuzz_test.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ func FuzzResponseReadLimitBody(f *testing.F) {
4747
return
4848
}
4949

50-
var res Response
50+
res := AcquireResponse()
51+
defer ReleaseResponse(res)
5152

5253
_ = res.ReadLimitBody(bufio.NewReader(bytes.NewReader(body)), max)
53-
w := bytes.Buffer{}
54-
_, _ = res.WriteTo(&w)
5554
})
5655
}
5756

@@ -63,11 +62,10 @@ func FuzzRequestReadLimitBody(f *testing.F) {
6362
return
6463
}
6564

66-
var req Request
65+
req := AcquireRequest()
66+
defer ReleaseRequest(req)
6767

6868
_ = req.ReadLimitBody(bufio.NewReader(bytes.NewReader(body)), max)
69-
w := bytes.Buffer{}
70-
_, _ = req.WriteTo(&w)
7169
})
7270
}
7371

0 commit comments

Comments
 (0)