]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #506: Python Module Seems to Leak Memory if it Experiences an
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 2 Jul 2021 07:42:31 +0000 (09:42 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 2 Jul 2021 07:42:31 +0000 (09:42 +0200)
  Unhandled Exception.

doc/Changelog
pythonmod/pythonmod.c

index f4b1295b2c307f28e15ce1a7bdda40de44462029..221b6c69b60aa60ffb40afe8c6b4de6bafc3c7b1 100644 (file)
@@ -1,3 +1,7 @@
+2 July 2021: Wouter
+       - Fix #506: Python Module Seems to Leak Memory if it Experiences an
+         Unhandled Exception.
+
 25 June 2021: Wouter
        - Fix up permissions on rpl data file in tests.
        - Fix testbound newline treatment in moment_read and tempfile write.
index 0bbdeeb6bf99e8cfa0849b451c45ebe24819b1d6..4bea54e6aceb6c5918fe8fe8e5b6e3fab82810d9 100644 (file)
@@ -245,6 +245,11 @@ cleanup:
        /* clear the exception, by not restoring it */
        /* Restore the exception state */
        /* PyErr_Restore(exc_typ, exc_val, exc_tb); */
+       /* when using PyErr_Restore there is no need to Py_XDECREF for
+        * these 3 pointers. */
+       Py_XDECREF(exc_typ);
+       Py_XDECREF(exc_val);
+       Py_XDECREF(exc_tb);
 }
 
 int pythonmod_init(struct module_env* env, int id)