Bug 252169 - _web_capitalizeRFC822HeaderFieldName leaks memory
Summary: _web_capitalizeRFC822HeaderFieldName leaks memory
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-13 07:45 PST by Seija K.
Modified: 2023-02-13 09:41 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Seija K. 2023-02-13 07:45:29 PST
We do not free the backing buffer because we pass nullptr as the last argument to the noCopy functions and never explicitly deallocate.
Comment 1 Seija K. 2023-02-13 07:48:14 PST
Pull request: https://github.com/WebKit/WebKit/pull/10039
Comment 2 Darin Adler 2023-02-13 08:37:33 PST
How did you notice this bug? Code inspection or some type of testing. Could you supply more context to your work?

The WebKit project requires regression tests when we fix bugs. Maybe we can forgo that in this case but I would like to know more about how it was discovered to make that decision.
Comment 3 Darin Adler 2023-02-13 09:41:07 PST
If we made a test, we’d see there’s no bug here. We do free the backing buffer. Passing nullptr as the last argument tells it to use the default allocator to deallocate.