Skip to content

Commit

Permalink
Increment ref count before adding objects to the pytun module.
Browse files Browse the repository at this point in the history
  • Loading branch information
montag451 committed Mar 14, 2012
1 parent 5bab204 commit c80091d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pytun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -638,6 +639,7 @@ PyMODINIT_FUNC initpytun(void)
{
return;
}
Py_INCREF(pytun_error);
if (PyModule_AddObject(m, "Error", pytun_error) != 0)
{
return;
Expand Down

0 comments on commit c80091d

Please sign in to comment.