Of course, when I start freeing things in response to valgrind's
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 3 Sep 2002 09:26:58 +0000 (09:26 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 3 Sep 2002 09:26:58 +0000 (09:26 +0000)
complaints, it would probably help if I arranged that those things
had been _allocated_ in all cases, otherwise we merely exchange a
memory leak for a core dump. Duh.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@1916 cda61777-01e9-0310-a592-d414129be87e

bk_text.c
bk_xhtml.c

index 1c8cfb9..48e99f4 100644 (file)
--- a/bk_text.c
+++ b/bk_text.c
@@ -96,7 +96,7 @@ static textconfig text_configure(paragraph *source) {
            } else if (!ustricmp(source->keyword, L"text-chapter-numeric")) {
                ret.achapter.just_numbers = utob(uadv(source->keyword));
            } else if (!ustricmp(source->keyword, L"text-chapter-suffix")) {
-               ret.achapter.number_suffix = uadv(source->keyword);
+               ret.achapter.number_suffix = ustrdup(uadv(source->keyword));
            } else if (!ustricmp(source->keyword, L"text-section-align")) {
                wchar_t *p = uadv(source->keyword);
                int n = 0;
@@ -156,7 +156,7 @@ static textconfig text_configure(paragraph *source) {
                        ret.asect[i] = ret.asect[ret.nasect-1];
                    ret.nasect = n+1;
                }
-               ret.asect[n].number_suffix = p;
+               ret.asect[n].number_suffix = ustrdup(p);
            } else if (!ustricmp(source->keyword, L"text-title-align")) {
                ret.atitle.align = utoalign(uadv(source->keyword));
            } else if (!ustricmp(source->keyword, L"text-title-underline")) {
index edab934..140e2dd 100644 (file)
@@ -199,7 +199,7 @@ static xhtmlconfig xhtml_configure(paragraph *source)
       } else if (!ustricmp(source->keyword, L"xhtml-chapter-numeric")) {
        ret.fchapter.just_numbers = utob(uadv(source->keyword));
       } else if (!ustricmp(source->keyword, L"xhtml-chapter-suffix")) {
-       ret.fchapter.number_suffix = uadv(source->keyword);
+       ret.fchapter.number_suffix = ustrdup(uadv(source->keyword));
       } else if (!ustricmp(source->keyword, L"xhtml-section-numeric")) {
        wchar_t *p = uadv(source->keyword);
        int n = 0;
@@ -229,7 +229,7 @@ static xhtmlconfig xhtml_configure(paragraph *source)
            ret.fsect[i] = ret.fsect[ret.nfsect-1];
          ret.nfsect = n+1;
        }
-       ret.fsect[n].number_suffix = p;
+       ret.fsect[n].number_suffix = ustrdup(p);
       }
     }
   }