From dbe282b355dbab158600ac99787e1ad96b644722 Mon Sep 17 00:00:00 2001 From: Brian Rosenberg Date: Thu, 15 Jun 2023 07:51:15 -0400 Subject: [PATCH] Fix memory leak in KeywordTagging --- cpp/KeywordTagging/KeywordTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/KeywordTagging/KeywordTagging.cpp b/cpp/KeywordTagging/KeywordTagging.cpp index ba3cf646..7f466574 100644 --- a/cpp/KeywordTagging/KeywordTagging.cpp +++ b/cpp/KeywordTagging/KeywordTagging.cpp @@ -67,7 +67,7 @@ KeywordTagging::parse_json(const MPFJob &job, const string &jsonfile_path) { x = boost::locale::conv::utf_to_utf(j); - JSONValue *value = JSON::Parse(x.c_str()); + auto value = std::unique_ptr(JSON::Parse(x.c_str())); if (value == NULL) { throw MPFDetectionException(MPF_COULD_NOT_READ_DATAFILE,