Fix a bug that prevents NPAPI plugins from retrieving cookies. b=526462 r=roc
authorJosh Aas <joshmoz@gmail.com>
Wed, 25 Nov 2009 02:40:46 -0500
changeset 35232 d76583175408f2e6fe03ff69408e0831e6a0e7c7
parent 35231 daa5346f19d6bede57bbb5b7cbd729dc921ea363
child 35233 2e8553f076f8bfe418eb65e0265e9ec7b6514ad6
child 35368 bc3e1f7a9a09bb673daa73925bba9a1464206626
push idunknown
push userunknown
push dateunknown
reviewersroc
bugs526462
milestone1.9.3a1pre
Fix a bug that prevents NPAPI plugins from retrieving cookies. b=526462 r=roc
modules/plugin/base/src/nsNPAPIPlugin.cpp
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -2427,19 +2427,19 @@ NPError NP_CALLBACK
 
       // Make an nsURI from the url argument
       nsCOMPtr<nsIURI> uri;
       if (NS_FAILED(NS_NewURI(getter_AddRefs(uri), nsDependentCString(url)))) {
         return NPERR_GENERIC_ERROR;
       }
 
       nsXPIDLCString cookieStr;
-      if (NS_FAILED(cookieService->GetCookieString(uri, nsnull,
-                                                   getter_Copies(cookieStr))) ||
-          !cookieStr) {
+      nsresult cookieReturn = cookieService->GetCookieString(uri, nsnull,
+                                                             getter_Copies(cookieStr));
+      if (NS_FAILED(cookieReturn) || !cookieStr) {
         return NPERR_GENERIC_ERROR;
       }
 
       *value = PL_strndup(cookieStr, cookieStr.Length());
 
       if (*value) {
         *len = cookieStr.Length();