diff --git a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp index 166d4fa46b7..ba1bf784be3 100644 --- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp +++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp @@ -3834,11 +3834,17 @@ nsWebBrowserPersist::MakeAndStoreLocalFilenameInURIMap( // Create a sensibly named filename for the URI and store in the URI map nsCStringKey key(spec.get()); + URIData *data; if (mURIMap.Exists(&key)) { + data = (URIData *) mURIMap.Get(&key); + if (aNeedsPersisting) + { + data->mNeedsPersisting = PR_TRUE; + } if (aData) { - *aData = (URIData *) mURIMap.Get(&key); + *aData = data; } return NS_OK; } @@ -3849,7 +3855,7 @@ nsWebBrowserPersist::MakeAndStoreLocalFilenameInURIMap( NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); // Store the file name - URIData *data = new URIData; + data = new URIData; NS_ENSURE_TRUE(data, NS_ERROR_OUT_OF_MEMORY); data->mNeedsPersisting = aNeedsPersisting;