Bug 147562 - Make sure error handling code APIUserContentExtensionStore closes open file descriptors
Summary: Make sure error handling code APIUserContentExtensionStore closes open file d...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-03 10:34 PDT by Chris Dumez
Modified: 2015-08-08 14:26 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.19 KB, patch)
2015-08-03 10:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (3.22 KB, patch)
2015-08-03 11:03 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-08-03 10:34:05 PDT
Make sure error handling code APIUserContentExtensionStore closes open file descriptors to avoid leaking them.
Comment 1 Chris Dumez 2015-08-03 10:35:38 PDT
Created attachment 258074 [details]
Patch
Comment 2 Chris Dumez 2015-08-03 11:03:43 PDT
Created attachment 258081 [details]
Patch
Comment 3 Alex Christensen 2015-08-03 14:24:12 PDT
Comment on attachment 258081 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2015-08-03 14:30:49 PDT
Comment on attachment 258081 [details]
Patch

Clearing flags on attachment: 258081

Committed r187765: <http://trac.webkit.org/changeset/187765>
Comment 5 WebKit Commit Bot 2015-08-03 14:30:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2015-08-08 14:26:28 PDT
Comment on attachment 258081 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258081&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp:87
>  Data adoptAndMapFile(int fd, size_t offset, size_t size)

Can we change the code to use a class that is like a smart pointer so we don’t have to do this kind of careful programming? It’s too easy to make these kinds of mistakes if we have to do it all manually.