diff --git a/src/kits/network/libnetapi/DataRequest.cpp b/src/kits/network/libnetapi/DataRequest.cpp index 8da5fcc95a..b2fd9002a3 100644 --- a/src/kits/network/libnetapi/DataRequest.cpp +++ b/src/kits/network/libnetapi/DataRequest.cpp @@ -90,8 +90,11 @@ BDataRequest::_ProtocolLoop() // There may be some padding at the end of the base64 stream. This // prevents us from computing the exact length we should get, so allow // for some error margin. - if(length > data.Length() * 4 / 3 || length < data.Length() * 4 / 3 - 3) + if(length > data.Length() * 4 / 3 + || length < data.Length() * 4 / 3 - 3) { + delete[] buffer; return B_BAD_DATA; + } } else { payload = data.String(); length = data.Length();