szaszm commented on a change in pull request #857:
URL: https://github.com/apache/nifi-minifi-cpp/pull/857#discussion_r481046465



##########
File path: libminifi/src/ResourceClaim.cpp
##########
@@ -41,22 +41,28 @@ void setDefaultDirectory(std::string path) {
 }
 
 
ResourceClaim::ResourceClaim(std::shared_ptr<core::StreamManager<ResourceClaim>>
 claim_manager)
-    : claim_manager_(claim_manager),
-      deleted_(false),
-      logger_(logging::LoggerFactory<ResourceClaim>::getLogger()) {
-  auto contentDirectory = claim_manager_->getStoragePath();
-  if (contentDirectory.empty())
-    contentDirectory = default_directory_path;
+    : claim_manager_(std::move(claim_manager)),
+      logger_(logging::LoggerFactory<ResourceClaim>::getLogger()),
+      _contentFullPath(([&] {
+        auto contentDirectory = claim_manager->getStoragePath();

Review comment:
       This is a null pointer dereference after `claim_manager` is moved-from 
in line 44. Use the member `claim_manager_` to avoid this.
   
   The lambda is unnecessarily wrapped in parentheses.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to