Changeset 94398 in webkit


Ignore:
Timestamp:
Sep 2, 2011, 3:21:56 AM (14 years ago)
Author:
mrowe@apple.com
Message:

<http://webkit.org/b/67467> WebProcessProxy::secItemCopyMatching / WebProcessProxy::secItemAdd
leak the results of the APIs they wrap.

Reviewed by Dan Bernstein.

  • UIProcess/mac/WebProcessProxyMac.mm:

(WebKit::WebProcessProxy::secItemCopyMatching): Adopt the result of SecItemCopyMatching in to a
RetainPtr to ensure it gets released at the appropriate time.
(WebKit::WebProcessProxy::secItemAdd): Ditto for SecItemAdd.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r94371 r94398  
     12011-09-02  Mark Rowe  <mrowe@apple.com>
     2
     3        <http://webkit.org/b/67467> WebProcessProxy::secItemCopyMatching / WebProcessProxy::secItemAdd
     4        leak the results of the APIs they wrap.
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * UIProcess/mac/WebProcessProxyMac.mm:
     9        (WebKit::WebProcessProxy::secItemCopyMatching): Adopt the result of SecItemCopyMatching in to a
     10        RetainPtr to ensure it gets released at the appropriate time.
     11        (WebKit::WebProcessProxy::secItemAdd): Ditto for SecItemAdd.
     12
    1132011-09-01  Ada Chan  <adachan@apple.com>
    214
  • trunk/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm

    r87627 r94398  
    3838{
    3939    CFDictionaryRef query = queryData.query();
    40     CFTypeRef resultObject;
    41     OSStatus resultCode;
     40    CFTypeRef resultObjectRef;
     41    OSStatus resultCode = SecItemCopyMatching(query, &resultObjectRef);
    4242
    43     resultCode = SecItemCopyMatching(query, &resultObject);
    44 
    45     result = SecItemResponseData(resultCode, resultObject);
     43    RetainPtr<CFTypeRef> resultObject(AdoptCF, resultObjectRef);
     44    result = SecItemResponseData(resultCode, resultObject.get());
    4645}
    4746
     
    4948{
    5049    CFDictionaryRef query = queryData.query();
    51     CFTypeRef resultObject;
    52     OSStatus resultCode;
     50    CFTypeRef resultObjectRef;
     51    OSStatus resultCode = SecItemAdd(query, &resultObjectRef);
    5352
    54     resultCode = SecItemAdd(query, &resultObject);
    55 
    56     result = SecItemResponseData(resultCode, resultObject);
     53    RetainPtr<CFTypeRef> resultObject(AdoptCF, resultObjectRef);
     54    result = SecItemResponseData(resultCode, resultObject.get());
    5755}
    5856
Note: See TracChangeset for help on using the changeset viewer.