diff --git a/mozilla/lib/libmisc/shist.c b/mozilla/lib/libmisc/shist.c index f1e39a4d04d..4fcef2928fd 100644 --- a/mozilla/lib/libmisc/shist.c +++ b/mozilla/lib/libmisc/shist.c @@ -90,7 +90,7 @@ SHIST_FreeHistoryEntry (MWContext * ctxt, History_entry * entry) XP_FREE(entry->wysiwyg_url); if(entry->page_services_url) XP_FREE(entry->page_services_url); - if(entry->privacy_policy_url) + if(entry->privacy_policy_url && entry->privacy_policy_url != (char*)(-1)) XP_FREE(entry->privacy_policy_url); #ifdef MOZ_NGLAYOUT @@ -181,7 +181,11 @@ SHIST_CreateHistoryEntry (URL_Struct * URL_s, char * title) StrAllocCopy(new_entry->content_name, URL_s->content_name); StrAllocCopy(new_entry->post_data, URL_s->post_data); StrAllocCopy(new_entry->post_headers, URL_s->post_headers); - StrAllocCopy(new_entry->privacy_policy_url, URL_s->privacy_policy_url); + if (URL_s->privacy_policy_url == (char*)(-1)) { + new_entry->privacy_policy_url = (char*)(-1); + } else { + StrAllocCopy(new_entry->privacy_policy_url, URL_s->privacy_policy_url); + } StrAllocCopy(new_entry->page_services_url, URL_s->page_services_url); StrAllocCopy(new_entry->etag, URL_s->etag); @@ -419,7 +423,11 @@ SHIST_CloneEntry(History_entry * old_entry) StrAllocCopy(new_entry->title, old_entry->title); StrAllocCopy(new_entry->address, old_entry->address); StrAllocCopy(new_entry->content_name, old_entry->content_name); - StrAllocCopy(new_entry->privacy_policy_url, old_entry->privacy_policy_url); + if (old_entry->privacy_policy_url == (char*)(-1)) { + new_entry->privacy_policy_url = (char*)(-1); + } else { + StrAllocCopy(new_entry->privacy_policy_url, old_entry->privacy_policy_url); + } StrAllocCopy(new_entry->referer, old_entry->referer); StrAllocCopy(new_entry->post_data, old_entry->post_data); StrAllocCopy(new_entry->post_headers, old_entry->post_headers); diff --git a/mozilla/network/main/mkgeturl.c b/mozilla/network/main/mkgeturl.c index 06ee490f9ef..177d388bc0c 100644 --- a/mozilla/network/main/mkgeturl.c +++ b/mozilla/network/main/mkgeturl.c @@ -4511,8 +4511,12 @@ NET_FreeURLStruct (URL_Struct * URL_s) PR_FREEIF(URL_s->add_crlf); PR_FREEIF(URL_s->page_services_url); - PR_FREEIF(URL_s->privacy_policy_url); + if (URL_s->privacy_policy_url != (char*)(-1)) { + PR_FREEIF(URL_s->privacy_policy_url); + } else { + URL_s->privacy_policy_url = NULL; + } #ifdef TRUST_LABELS /* delete the entries and the trust list, if the list was created then there