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



##########
File path: extensions/windows-event-log/wel/WindowsEventLog.cpp
##########
@@ -129,34 +133,30 @@ std::string 
WindowsEventLogMetadataImpl::getEventData(EVT_FORMAT_MESSAGE_FLAGS f
     return event_data;
   }
 
-  if (!EvtFormatMessage(metadata_ptr_, event_ptr_, 0, 0, NULL, flags, 
string_buffer_size, string_buffer, &string_buffer_used)) {
+
+  if (!EvtFormatMessage(metadata_ptr_, event_ptr_, 0, 0, NULL, flags, 
string_buffer_size, string_buffer.get(), &string_buffer_used)) {
     result = GetLastError();
     if (ERROR_INSUFFICIENT_BUFFER == result) {
       string_buffer_size = string_buffer_used;
 
-      string_buffer = (LPWSTR) malloc(string_buffer_size * sizeof(WCHAR));
-
-      if (string_buffer) {
+      string_buffer.reset((LPWSTR) malloc(string_buffer_size * sizeof(WCHAR)));

Review comment:
       oops, this is outdated




----------------------------------------------------------------
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