<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - pdfunite: embedded files discarded during merge"
href="https://bugs.freedesktop.org/show_bug.cgi?id=90066#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - pdfunite: embedded files discarded during merge"
href="https://bugs.freedesktop.org/show_bug.cgi?id=90066">bug 90066</a>
from <span class="vcard"><a class="email" href="mailto:jason@aquaticape.us" title="Jason Crain <jason@aquaticape.us>"> <span class="fn">Jason Crain</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=115174" name="attach_115174" title="insert embedded files in result pdf">attachment 115174</a> <a href="attachment.cgi?id=115174&action=edit" title="insert embedded files in result pdf">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=90066&attachment=115174'>[review]</a>
insert embedded files in result pdf
Review of <span class=""><a href="attachment.cgi?id=115174" name="attach_115174" title="insert embedded files in result pdf">attachment 115174</a> <a href="attachment.cgi?id=115174&action=edit" title="insert embedded files in result pdf">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=90066&attachment=115174'>[review]</a>:
-----------------------------------------------------------------
::: utils/pdfunite.cc
@@ +42,5 @@
<span class="quote">> + Object srcNameArray;
> + mergeNameTree->lookup("Names", &mergeNameArray);
> + srcNameTree->lookup("Names", &srcNameArray);
> + if (mergeNameArray.isArray() && srcNameArray.isArray()) {
> + Object *newNameArray = new Object();</span >
You are leaking newNameArray in a couple places. srcNameTree->set/add will
make a shallow copy so you shouldn't call newNameArray->free, but you still
need to delete the Object. Or use a stack variable.
@@ +61,5 @@
<span class="quote">> + if (mkey.getString()->cmp(key.getString()) < 0) {
> + Object *newKey = new Object();
> + newKey->initString(new GooString(mkey.getString()->getCString()));
> + newNameArray->arrayAdd(newKey);
> + Object *newValue = new Object();</span >
same, newKey and newValue are being leaked in a few places. Object::arrayAdd
makes a shallow copy.
@@ +249,5 @@
<span class="quote">> }
> + catDict->lookup("Names", &names);
> + if (!names.isNull() && names.isDict()) {
> + docs[0]->markPageObjects(names.getDict(), yRef, countRef, 0, refPage->num, refPage->num);
> + }</span >
You are processing the first document twice, first here and again below.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>