diff --git a/extensions/cookie/nsCookie.cpp b/extensions/cookie/nsCookie.cpp index 49cbb70b113c..3f7a96bb06ce 100644 --- a/extensions/cookie/nsCookie.cpp +++ b/extensions/cookie/nsCookie.cpp @@ -1490,7 +1490,7 @@ cookie_SetCookieString(char * curURL, char * setCookieHeader, time_t timeToExpir tmp_cookie_ptr = NS_STATIC_CAST(cookie_CookieStruct*, cookie_cookieList->ElementAt(i)); if (tmp_cookie_ptr) { if(new_len > PL_strlen(tmp_cookie_ptr->path)) { - cookie_cookieList->InsertElementAt(tmp_cookie_ptr, i); + cookie_cookieList->InsertElementAt(prev_cookie, i); bCookieAdded = PR_TRUE; break; }