aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QUtil.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-07 14:02:16 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-07 20:08:46 +0100
commitdf2f5c6a360bd7512d2280aa9cb582bc0aa622bd (patch)
treef7a036ddeee36a172e1903056e7f4ed49a323efd /libqpdf/QUtil.cc
parentcfaae47dc6704a54e3e84decbfbe8840c33f2fc4 (diff)
downloadqpdf-df2f5c6a360bd7512d2280aa9cb582bc0aa622bd.tar.zst
Add QUtil::make_shared_array to help with PointerHolder transition
Diffstat (limited to 'libqpdf/QUtil.cc')
-rw-r--r--libqpdf/QUtil.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc
index 503d79f9..1f179fd5 100644
--- a/libqpdf/QUtil.cc
+++ b/libqpdf/QUtil.cc
@@ -735,9 +735,7 @@ QUtil::copy_string(std::string const& str)
std::shared_ptr<char>
QUtil::make_shared_cstr(std::string const& str)
{
- auto result = std::shared_ptr<char>(
- new char[str.length() + 1],
- std::default_delete<char[]>());
+ auto result = QUtil::make_shared_array<char>(str.length() + 1);
// Use memcpy in case string contains nulls
result.get()[str.length()] = '\0';
memcpy(result.get(), str.c_str(), str.length());