]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Remove memory leak on pythonmod python2 script file init.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 28 Feb 2019 09:12:54 +0000 (09:12 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 28 Feb 2019 09:12:54 +0000 (09:12 +0000)
- Remove swig gcc8 python function cast warnings, they are ignored.

git-svn-id: file:///svn/unbound/trunk@5127 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
libunbound/python/libunbound.i
pythonmod/interface.i
pythonmod/pythonmod.c

index 6e5b5966236d1c61d3346dc41578cd1aacbfae16..46b678acff4dcc730d03e89211494171be6f593c 100644 (file)
@@ -1,3 +1,7 @@
+28 February 2019: Wouter
+       - Remove memory leak on pythonmod python2 script file init.
+       - Remove swig gcc8 python function cast warnings, they are ignored.
+
 27 February 2019: Wouter
        - Fix #4229: Unbound man pages lack information, about access-control
          order and local zone tags, and elements in views.
index 4af75637c4f5ebe1992e8f080f5b8a7193f6e209..6196a3979c4a37dba6bdc5c85b06478b852ebded 100644 (file)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+%begin %{
+/* store state of warning output, restored at later pop */
+#pragma GCC diagnostic push
+/* ignore gcc8 METH_NOARGS function cast warnings for swig function pointers */
+#pragma GCC diagnostic ignored "-Wcast-function-type"
+%}
 %module unbound
 %{
+/* restore state of warning output, remove the functioncast ignore */
+#pragma GCC diagnostic pop
    #include <sys/types.h>
    #ifdef HAVE_SYS_SOCKET_H
    #include <sys/socket.h>
index 9b5e15a4a78d6bbad04ea47189d7a82064454dc6..f9fd07b513d650ed7e26c420dafcc09b9617e273 100644 (file)
@@ -1,8 +1,16 @@
 /*
  * interface.i: unbound python module
  */
+%begin %{
+/* store state of warning output, restored at later pop */
+#pragma GCC diagnostic push
+/* ignore gcc8 METH_NOARGS function cast warnings for swig function pointers */
+#pragma GCC diagnostic ignored "-Wcast-function-type"
+%}
 %module unboundmodule
 %{
+/* restore state of warning output, remove the functioncast ignore */
+#pragma GCC diagnostic pop
 /**
  * \file
  * This is the interface between the unbound server and a python module
index 459ae1e8cf2d2019b05e57d6e8d5ef61c155f08a..9009a28daaa0644349fe3fb4002bcf789f7bee15 100644 (file)
@@ -354,7 +354,11 @@ int pythonmod_init(struct module_env* env, int id)
       PyGILState_Release(gil);
       return 0;
    }
+#if PY_MAJOR_VERSION < 3
+   Py_XDECREF(PyFileObject);
+#else
    fclose(script_py);
+#endif
 
    if ((pe->func_init = PyDict_GetItemString(pe->dict, "init_standard")) == NULL)
    {