This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new f16cee80e50 Pipe: Fixed the bug that OPC DA sink may free a string 
multiple times (#15165)
f16cee80e50 is described below

commit f16cee80e50f7fc54fceb6d258cc3940af9e9542
Author: Caideyipi <[email protected]>
AuthorDate: Fri Mar 21 20:34:24 2025 +0800

    Pipe: Fixed the bug that OPC DA sink may free a string multiple times 
(#15165)
    
    Co-authored-by: Steve Yurong Su <[email protected]>
---
 .../iotdb/db/pipe/connector/protocol/opcda/OpcDaServerHandle.java    | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcda/OpcDaServerHandle.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcda/OpcDaServerHandle.java
index 167fd4988f6..48d7c415ab3 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcda/OpcDaServerHandle.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcda/OpcDaServerHandle.java
@@ -65,7 +65,6 @@ public class OpcDaServerHandle implements Closeable {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(OpcDaServerHandle.class);
 
-  private final PointerByReference ppvServer = new PointerByReference();
   private final OpcDaHeader.IOPCServer opcServer;
   private final OpcDaHeader.IOPCItemMgt itemMgt;
   private final OpcDaHeader.IOPCSyncIO syncIO;
@@ -269,6 +268,7 @@ public class OpcDaServerHandle implements Closeable {
     // Free after write
     if (Objects.nonNull(bstr)) {
       OleAuto.INSTANCE.SysFreeString(bstr);
+      bstr = null;
     }
 
     final Pointer pErrors = ppErrors.getValue();
@@ -370,9 +370,6 @@ public class OpcDaServerHandle implements Closeable {
     serverHandleMap.clear();
 
     // Release resource
-    if (Objects.nonNull(ppvServer.getValue())) {
-      Ole32.INSTANCE.CoTaskMemFree(ppvServer.getValue());
-    }
     if (Objects.nonNull(syncIO)) {
       syncIO.Release();
     }

Reply via email to