mirror of
https://review.haiku-os.org/haiku
synced 2025-02-07 14:25:58 +01:00
unix: Fix another leak of ancillary data.
This time in the datagram logic. Also clean up some of the logic around unsetting the data from the request after adding it. (cherry picked from commit 3fb6cfce6b4b586a5a76fc4c269c9944f06307e6) Change-Id: I8dbb824503b8c3cbcdc2e11dde6ac03d244d1a35 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8062 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
23b9ef334f
commit
64ec22728b
@ -77,9 +77,9 @@ UnixRequest::GetCurrentChunk(void*& data, size_t& size)
|
||||
|
||||
|
||||
void
|
||||
UnixRequest::SetAncillaryData(ancillary_data_container* data)
|
||||
UnixRequest::UnsetAncillaryData()
|
||||
{
|
||||
fAncillaryData = data;
|
||||
fAncillaryData = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -213,6 +213,7 @@ UnixBufferQueue::Read(UnixRequest& request)
|
||||
while (entry != NULL && offsetDelta > entry->offset) {
|
||||
fAncillaryData.RemoveHead();
|
||||
offsetDelta -= entry->offset;
|
||||
gStackModule->delete_ancillary_data_container(entry->data);
|
||||
delete entry;
|
||||
|
||||
entry = fAncillaryData.Head();
|
||||
@ -296,7 +297,7 @@ UnixBufferQueue::Write(UnixRequest& request)
|
||||
if (ancillaryEntry != NULL) {
|
||||
fAncillaryData.Add(ancillaryEntry);
|
||||
ancillaryEntryDeleter.Detach();
|
||||
request.SetAncillaryData(NULL);
|
||||
request.UnsetAncillaryData();
|
||||
ancillaryEntry = NULL;
|
||||
}
|
||||
|
||||
|
@ -47,8 +47,8 @@ public:
|
||||
bool GetCurrentChunk(void*& data, size_t& size);
|
||||
|
||||
ancillary_data_container* AncillaryData() const { return fAncillaryData; }
|
||||
void SetAncillaryData(ancillary_data_container* data);
|
||||
void AddAncillaryData(ancillary_data_container* data);
|
||||
void UnsetAncillaryData();
|
||||
|
||||
struct sockaddr_storage* Address() const { return fAddress; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user