Skip to content

Commit ea0b10f

Browse files
committed
Fix memory leak on failed inspect hostcall
1 parent 4b3a1d8 commit ea0b10f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

runtime/fastly/host-api/host_api.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,6 +2442,7 @@ Result<HostString> Request::inspect(const InspectOptions *config) {
24422442
if (!convert_result(fastly::req_inspect(this->req.handle, this->body.handle, inspect_opts_mask,
24432443
&opts, ret.ptr, HOSTCALL_BUFFER_LEN, &ret.len),
24442444
&err)) {
2445+
cabi_free(ret.ptr);
24452446
res.emplace_err(err);
24462447
} else {
24472448
res.emplace(make_host_string(ret));

0 commit comments

Comments
 (0)