You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/09/04 12:35:11 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a change in pull request #896: MINIFICPP-1353 Fix a heap-use-after-free error

fgerlits commented on a change in pull request #896:
URL: https://github.com/apache/nifi-minifi-cpp/pull/896#discussion_r483587276



##########
File path: extensions/http-curl/processors/InvokeHTTP.cpp
##########
@@ -283,6 +283,10 @@ void InvokeHTTP::onTrigger(const std::shared_ptr<core::ProcessContext> &context,
   // create a transaction id
   std::string tx_id = generateId();
 
+  std::unique_ptr<utils::ByteInputCallBack> callback = nullptr;
+  std::unique_ptr<utils::HTTPUploadCallback> callbackObj = nullptr;
+
+  // Client declared after the callbacks to make sure the callbacks are still available when the client is destructed

Review comment:
       Good point, I have added a comment.  This is a good example when a comment is necessary, but it is also a code smell. :)




----------------------------------------------------------------
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:
users@infra.apache.org