From c80091d5ae179b2dde671983f4f937046562d519 Mon Sep 17 00:00:00 2001 From: montag451 Date: Wed, 14 Mar 2012 10:25:47 +0100 Subject: [PATCH] Increment ref count before adding objects to the pytun module. --- pytun.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytun.c b/pytun.c index f382d7e..1e8ffcc 100644 --- a/pytun.c +++ b/pytun.c @@ -622,6 +622,7 @@ PyMODINIT_FUNC initpytun(void) { return; } + Py_INCREF((PyObject*)&pytun_tuntap_type); if (PyModule_AddObject(m, "TunTapDevice", (PyObject*)&pytun_tuntap_type) != 0) { return; @@ -638,6 +639,7 @@ PyMODINIT_FUNC initpytun(void) { return; } + Py_INCREF(pytun_error); if (PyModule_AddObject(m, "Error", pytun_error) != 0) { return;