diff --git a/poppler/Annot.cc b/poppler/Annot.cc index f0cce6d..00291f8 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -4990,7 +4990,7 @@ void AnnotWidget::generateFieldAppearance() { } // build the appearance stream - appearStream = new MemStream(strdup(appearBuf->getCString()), 0, + appearStream = new MemStream(copyString(appearBuf->getCString()), 0, appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); diff --git a/poppler/Dict.cc b/poppler/Dict.cc index 3f3c022..4cf42dc 100644 --- a/poppler/Dict.cc +++ b/poppler/Dict.cc @@ -96,7 +96,7 @@ Dict::Dict(Dict* dictA) { sorted = dictA->sorted; entries = (DictEntry *)gmallocn(size, sizeof(DictEntry)); for (int i=0; ientries[i].key); + entries[i].key = copyString(dictA->entries[i].key); dictA->entries[i].val.copy(&entries[i].val); } }