| | @@ -788,11 +788,11 @@ |
| 788 | 788 | ){ |
| 789 | 789 | Blob title; |
| 790 | 790 | int isPopup = P("popup")!=0; |
| 791 | 791 | blob_init(&title,0,0); |
| 792 | 792 | if( fossil_strcmp(zMime, "text/x-fossil-wiki")==0 ){ |
| 793 | | - Blob tail; |
| 793 | + Blob tail = BLOB_INITIALIZER; |
| 794 | 794 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 795 | 795 | if( wiki_find_title(pBody, &title, &tail) ){ |
| 796 | 796 | if( !isPopup ) style_header("%s", blob_str(&title)); |
| 797 | 797 | wiki_convert(&tail, 0, WIKI_BUTTONS); |
| 798 | 798 | }else{ |
| | @@ -801,10 +801,11 @@ |
| 801 | 801 | } |
| 802 | 802 | if( !isPopup ){ |
| 803 | 803 | document_emit_js(); |
| 804 | 804 | style_finish_page(); |
| 805 | 805 | } |
| 806 | + blob_reset(&tail); |
| 806 | 807 | }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){ |
| 807 | 808 | Blob tail = BLOB_INITIALIZER; |
| 808 | 809 | markdown_to_html(pBody, &title, &tail); |
| 809 | 810 | if( !isPopup ){ |
| 810 | 811 | if( blob_size(&title)>0 ){ |
| | @@ -816,10 +817,11 @@ |
| 816 | 817 | convert_href_and_output(&tail); |
| 817 | 818 | if( !isPopup ){ |
| 818 | 819 | document_emit_js(); |
| 819 | 820 | style_finish_page(); |
| 820 | 821 | } |
| 822 | + blob_reset(&tail); |
| 821 | 823 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| 822 | 824 | style_header("%s", zDefaultTitle); |
| 823 | 825 | @ <blockquote><pre> |
| 824 | 826 | @ %h(blob_str(pBody)) |
| 825 | 827 | @ </pre></blockquote> |
| | @@ -949,10 +951,11 @@ |
| 949 | 951 | |
| 950 | 952 | login_check_credentials(); |
| 951 | 953 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 952 | 954 | style_set_current_feature("doc"); |
| 953 | 955 | blob_init(&title, 0, 0); |
| 956 | + blob_init(&filebody, 0, 0); |
| 954 | 957 | zDfltTitle = isUV ? "" : "Documentation"; |
| 955 | 958 | db_begin_transaction(); |
| 956 | 959 | while( rid==0 && (++nMiss)<=count(azSuffix) ){ |
| 957 | 960 | zName = P("name"); |
| 958 | 961 | if( isUV ){ |
| | @@ -1059,10 +1062,12 @@ |
| 1059 | 1062 | } |
| 1060 | 1063 | cgi_check_for_malice(); |
| 1061 | 1064 | document_render(&filebody, zMime, zDfltTitle, zName); |
| 1062 | 1065 | if( nMiss>=count(azSuffix) ) cgi_set_status(404, "Not Found"); |
| 1063 | 1066 | db_end_transaction(0); |
| 1067 | + blob_reset(&title); |
| 1068 | + blob_reset(&filebody); |
| 1064 | 1069 | return; |
| 1065 | 1070 | |
| 1066 | 1071 | /* Jump here when unable to locate the document */ |
| 1067 | 1072 | doc_not_found: |
| 1068 | 1073 | db_end_transaction(0); |
| | @@ -1075,10 +1080,12 @@ |
| 1075 | 1080 | @ <p>Document %h(zOrigName) not found |
| 1076 | 1081 | if( fossil_strcmp(zCheckin,"ckout")!=0 ){ |
| 1077 | 1082 | @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a> |
| 1078 | 1083 | } |
| 1079 | 1084 | style_finish_page(); |
| 1085 | + blob_reset(&title); |
| 1086 | + blob_reset(&filebody); |
| 1080 | 1087 | return; |
| 1081 | 1088 | } |
| 1082 | 1089 | |
| 1083 | 1090 | /* |
| 1084 | 1091 | ** The default logo. |
| 1085 | 1092 | |