diff Sources/DicomScpCallbacks.cpp @ 127:a862d554753f fix-leak

fixing leaks associated with setting integers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2023 10:47:30 +0200
parents 9ffe8881f856
children c55b0583084b
line wrap: on
line diff
--- a/Sources/DicomScpCallbacks.cpp	Wed Aug 30 10:32:26 2023 +0200
+++ b/Sources/DicomScpCallbacks.cpp	Wed Aug 30 10:47:30 2023 +0200
@@ -338,7 +338,10 @@
         PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.GetPyObject());
       }
 
-      PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", PyLong_FromUnsignedLong(originatorId_));
+      {
+        PythonObject tmp(lock, PyLong_FromUnsignedLong(originatorId_));
+        PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", tmp.GetPyObject());
+      }
 
       PythonObject args(lock, PyTuple_New(0));