diff --git a/mozilla/lib/libmisc/shist.c b/mozilla/lib/libmisc/shist.c index 5733bad267f..33824e52790 100644 --- a/mozilla/lib/libmisc/shist.c +++ b/mozilla/lib/libmisc/shist.c @@ -815,12 +815,15 @@ SHIST_SetTitleOfCurrentDoc( MWContext *context ) { /* StrAllocCopy( he->title, context->title ); */ /* Let's save the History as UTF8 */ - he->title = (char*)INTL_ConvertLineWithoutAutoDetect( - INTL_DefaultWinCharSetID(context), - CS_UTF8, - (unsigned char*) context->title, - XP_STRLEN(context->title) - ); + /* added by cmanske: free existing and check for null title */ + XP_FREEIF(he->title); + if( context->title ) + he->title = (char*)INTL_ConvertLineWithoutAutoDetect( + INTL_DefaultWinCharSetID(context), + CS_UTF8, + (unsigned char*) context->title, + XP_STRLEN(context->title) + ); /* * This is the place where we set the title for *global* history hash records * In addition to not making grid cells normal history entries we've added two