nfs4: Fix CID 991756: do not delete RPC::Request if (re)sending fails

This commit is contained in:
Pawel Dziepak 2013-03-21 03:16:42 +01:00
parent edb1255117
commit b6868c6e78
2 changed files with 5 additions and 3 deletions

View File

@ -161,7 +161,10 @@ Server::SendCallAsync(Call* call, Reply** reply, Request** request)
fRequests.AddRequest(req); fRequests.AddRequest(req);
*request = req; *request = req;
return ResendCallAsync(call, req); status_t error = ResendCallAsync(call, req);
if (error != B_OK)
delete req;
return error;
} }
@ -173,7 +176,6 @@ Server::ResendCallAsync(Call* call, Request* request)
if (fThreadError != B_OK && Repair() != B_OK) { if (fThreadError != B_OK && Repair() != B_OK) {
fRequests.FindRequest(request->fXID); fRequests.FindRequest(request->fXID);
delete request;
return fThreadError; return fThreadError;
} }
@ -181,7 +183,6 @@ Server::ResendCallAsync(Call* call, Request* request)
status_t result = fConnection->Send(stream.Buffer(), stream.Size()); status_t result = fConnection->Send(stream.Buffer(), stream.Size());
if (result != B_OK) { if (result != B_OK) {
fRequests.FindRequest(request->fXID); fRequests.FindRequest(request->fXID);
delete request;
return result; return result;
} }

View File

@ -56,6 +56,7 @@ Request::_SendUDP(Cookie* cookie)
if (result != B_OK) { if (result != B_OK) {
if (cookie != NULL) if (cookie != NULL)
cookie->UnregisterRequest(rpc); cookie->UnregisterRequest(rpc);
delete rpc;
return result; return result;
} }