Skip to content

Commit bca2697

Browse files
committed
Fix access after deletion of request
Accessing a BUrlRequest from an asynchronous handler is not safe, as the request may have changed state already. So we cannot get the URL from the request. For http requests, get it from the result instead.
1 parent 571a45d commit bca2697

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Source/WebCore/platform/network/haiku/BUrlProtocolHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ void BUrlProtocolHandler::HeadersReceived(BUrlRequest* caller,
493493
if (httpRequest) {
494494
const BHttpResult& hresult = static_cast<const BHttpResult&>(
495495
result);
496+
url = URL(hresult.Url());
496497
BString location = hresult.Headers()["Location"];
497498
if (location.Length() > 0) {
498499
m_redirected = true;

0 commit comments

Comments
 (0)