summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfppo.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-11 17:55:40 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-11 17:55:40 -0800
commit6e1d6032b7990cdf580c99ff491a1b761ee39ca6 (patch)
treec880c69a8ef1372511a0fecac0bf3d61b1eabe75 /fpdfsdk/fpdfppo.cpp
parent211d4edbe2f71ca62c76f36ce25090342c58e43c (diff)
downloadpdfium-6e1d6032b7990cdf580c99ff491a1b761ee39ca6.tar.xz
Fix unique ptrs in fpdfppo.cpp
There's a path out that deletes a pointer whose ownership was passed off earlier. This will get simpler once more APIs take unique_ptr. BUG=664284 Review-Url: https://codereview.chromium.org/2495003006
Diffstat (limited to 'fpdfsdk/fpdfppo.cpp')
-rw-r--r--fpdfsdk/fpdfppo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index f8b96de1f3..786bc46611 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -285,12 +285,12 @@ uint32_t CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
return 0;
}
}
- dwNewObjNum = pDoc->AddIndirectObject(pClone.get());
+ CPDF_Object* pUnownedClone = pClone.get();
+ dwNewObjNum = pDoc->AddIndirectObject(pClone.release());
(*pObjNumberMap)[dwObjnum] = dwNewObjNum;
- if (!UpdateReference(pClone.get(), pDoc, pObjNumberMap))
+ if (!UpdateReference(pUnownedClone, pDoc, pObjNumberMap))
return 0;
- pClone.release(); // TODO(tsepez): figure out ownership.
return dwNewObjNum;
}