Bug 147562

Summary: Make sure error handling code APIUserContentExtensionStore closes open file descriptors
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, andersca, benjamin, cgarcia, commit-queue, koivisto, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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.