mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-22 22:58:33 +00:00
QPDFJob: convert password to shared pointer
This commit is contained in:
parent
1a8c2eb93b
commit
021db6f226
@ -199,8 +199,7 @@ class QPDFJob
|
||||
|
||||
enum remove_unref_e { re_auto, re_yes, re_no };
|
||||
|
||||
char const* password;
|
||||
std::shared_ptr<char> password_alloc;
|
||||
std::shared_ptr<char> password;
|
||||
bool linearize;
|
||||
bool decrypt;
|
||||
int split_pages;
|
||||
|
@ -452,7 +452,7 @@ QPDFJob::run()
|
||||
std::shared_ptr<QPDF> pdf_ph;
|
||||
try
|
||||
{
|
||||
pdf_ph = processFile(o.infilename, o.password);
|
||||
pdf_ph = processFile(o.infilename, o.password.get());
|
||||
}
|
||||
catch (QPDFExc& e)
|
||||
{
|
||||
|
@ -178,7 +178,7 @@ ArgParser::argShowCrypto()
|
||||
void
|
||||
ArgParser::argPassword(char* parameter)
|
||||
{
|
||||
o.password = parameter;
|
||||
o.password = QUtil::make_shared_cstr(parameter);
|
||||
}
|
||||
|
||||
void
|
||||
@ -197,9 +197,7 @@ ArgParser::argPasswordFile(char* parameter)
|
||||
}
|
||||
if (lines.size() >= 1)
|
||||
{
|
||||
// Make sure the memory for this stays in scope.
|
||||
o.password_alloc = QUtil::make_shared_cstr(lines.front());
|
||||
o.password = o.password_alloc.get();
|
||||
o.password = QUtil::make_shared_cstr(lines.front());
|
||||
|
||||
if (lines.size() > 1)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user