Skip to content

Commit

Permalink
fix invalid url parsing memory leak (#2159)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikea authored May 24, 2024
1 parent 0ff3e54 commit e8ecf09
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/workerd/jsg/url.c++
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ kj::Maybe<Url> Url::tryParse(kj::ArrayPtr<const char> input,
} else {
result = ada_parse(input.begin(), input.size());
}
if (!ada_is_valid(result)) return kj::none;
if (!ada_is_valid(result)) {
ada_free(result);
return kj::none;
}
return Url(wrap(result));
}

Expand Down

0 comments on commit e8ecf09

Please sign in to comment.