diff Sources/IncomingHttpRequestFilter.cpp @ 126:9ffe8881f856 fix-leak

fixing more PyDict_SetItemString()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2023 10:32:26 +0200
parents eb6ac5a801d1
children a862d554753f
line wrap: on
line diff
--- a/Sources/IncomingHttpRequestFilter.cpp	Wed Aug 30 10:24:46 2023 +0200
+++ b/Sources/IncomingHttpRequestFilter.cpp	Wed Aug 30 10:32:26 2023 +0200
@@ -55,7 +55,7 @@
 
     {
       PythonString str(lock, ip);
-      PyDict_SetItemString(kw.GetPyObject(), "ip", str.Release());
+      PyDict_SetItemString(kw.GetPyObject(), "ip", str.GetPyObject());
     }
 
     {
@@ -64,10 +64,10 @@
       for (uint32_t i = 0; i < headersCount; i++)
       {
         PythonString str(lock, headersValues[i]);
-        PyDict_SetItemString(headers.GetPyObject(), headersKeys[i], str.Release());
+        PyDict_SetItemString(headers.GetPyObject(), headersKeys[i], str.GetPyObject());
       }
 
-      PyDict_SetItemString(kw.GetPyObject(), "headers", headers.Release());
+      PyDict_SetItemString(kw.GetPyObject(), "headers", headers.GetPyObject());
     }
 
     if (method == OrthancPluginHttpMethod_Get)
@@ -77,10 +77,10 @@
       for (uint32_t i = 0; i < getArgumentsCount; i++)
       {
         PythonString str(lock, getArgumentsValues[i]);
-        PyDict_SetItemString(getArguments.GetPyObject(), getArgumentsKeys[i], str.Release());
+        PyDict_SetItemString(getArguments.GetPyObject(), getArgumentsKeys[i], str.GetPyObject());
       }
 
-      PyDict_SetItemString(kw.GetPyObject(), "get", getArguments.Release());
+      PyDict_SetItemString(kw.GetPyObject(), "get", getArguments.GetPyObject());
     }
     
     PythonObject result(lock, PyObject_Call(incomingHttpRequestFilter_,