From 5f3f78822b5d43e9b02082da5268d186ba7101c0 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 5 Feb 2022 08:15:07 -0500 Subject: Improve use of std::unique_ptr * Use unique_ptr in place of shared_ptr in some cases * unique_ptr for arrays does not require a custom deleter * use std::make_unique (c++14) where possible --- libqpdf/QPDF_encryption.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libqpdf/QPDF_encryption.cc') diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc index 54c2dadc..5ce63e4c 100644 --- a/libqpdf/QPDF_encryption.cc +++ b/libqpdf/QPDF_encryption.cc @@ -1211,7 +1211,7 @@ QPDF::decryptString(std::string& str, int objid, int generation) size_t vlen = str.length(); // Using PointerHolder guarantees that tmp will // be freed even if rc4.process throws an exception. - auto tmp = QUtil::make_shared_cstr(str); + auto tmp = QUtil::make_unique_cstr(str); RC4 rc4(QUtil::unsigned_char_pointer(key), toI(key.length())); rc4.process(QUtil::unsigned_char_pointer(tmp.get()), vlen); str = std::string(tmp.get(), vlen); -- cgit v1.2.3-54-g00ecf