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

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


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

commit ecb500ed1c1bfc4ad71f413e98c8014068d3d50f
Author: Caideyipi <[email protected]>
AuthorDate: Fri Mar 21 20:36:45 2025 +0800

    Pipe: Fixed the bug that OPC DA sink may free a string multiple times 
(#15165) (#15166)
---
 .../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 3560bd26d3f..4f5c6e58a96 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;
@@ -268,6 +267,7 @@ public class OpcDaServerHandle implements Closeable {
     // Free after write
     if (Objects.nonNull(bstr)) {
       OleAuto.INSTANCE.SysFreeString(bstr);
+      bstr = null;
     }
 
     final Pointer pErrors = ppErrors.getValue();
@@ -369,9 +369,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