Skip to content

Commit 5d2b053

Browse files
Fixed a memory leak when enqueuing to a JSON queue with AQ.
1 parent bfdaddc commit 5d2b053

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Thick Mode Changes
5555
#) Fixed a bug resulting in a ``ValueError`` exception when getting attribute
5656
:attr:`MessageProperties.enqtime` if the value is not available or
5757
``None``.
58+
#) Fixed a memory leak when enqueuing to JSON queues with
59+
:ref:`Oracle Advanced Queuing <aqusermanual>`.
5860

5961
Common Changes
6062
++++++++++++++

src/oracledb/impl/thick/queue.pyx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2020, 2022, Oracle and/or its affiliates.
2+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
33
#
44
# This software is dual-licensed to you under the Universal Permissive License
55
# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -600,10 +600,13 @@ cdef class ThickMsgPropsImpl(BaseMsgPropsImpl):
600600
json_buf.from_object(json_val)
601601
if dpiConn_newJson(self._conn_impl._handle, &json) < 0:
602602
_raise_from_odpi()
603-
if dpiJson_setValue(json, &json_buf._top_node) < 0:
604-
_raise_from_odpi()
605-
if dpiMsgProps_setPayloadJson(self._handle, json) < 0:
606-
_raise_from_odpi()
603+
try:
604+
if dpiJson_setValue(json, &json_buf._top_node) < 0:
605+
_raise_from_odpi()
606+
if dpiMsgProps_setPayloadJson(self._handle, json) < 0:
607+
_raise_from_odpi()
608+
finally:
609+
dpiJson_release(json)
607610

608611
def set_priority(self, int32_t value):
609612
"""

0 commit comments

Comments
 (0)