From 5fcea2b4e2bfd5f3824dcd6f9d32693192122156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Thu, 15 Apr 2021 06:47:38 +0200 Subject: [PATCH] Use stack variables instead of java style --- src/exiv2.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/exiv2.cpp b/src/exiv2.cpp index 13c6b2e6..f5c07354 100644 --- a/src/exiv2.cpp +++ b/src/exiv2.cpp @@ -1042,13 +1042,12 @@ int Params::getopt(int argc, char* const Argv[]) longs["--years" ] = "-Y"; for ( int i = 0 ; i < argc ; i++ ) { - std::string* arg = new std::string(Argv[i]); - if (longs.find(*arg) != longs.end() ) { - argv[i] = ::strdup(longs[*arg].c_str()); + std::string arg(Argv[i]); + if (longs.find(arg) != longs.end() ) { + argv[i] = ::strdup(longs[arg].c_str()); } else { argv[i] = ::strdup(Argv[i]); } - delete arg; } int rc = Util::Getopt::getopt(argc, argv, optstring_);