File: py_GeoIP.c
Function: GeoIP_open_Py
Error: ob_refcnt of '*GeoIP' is 1 too high
56 static PyObject*
57 GeoIP_open_Py(PyObject* self, PyObject *args) {
58   GeoIP_GeoIPObject* GeoIP;
59   char * filename;
60   int flags;
61 
62   if (!PyArg_ParseTuple(args, "si", &filename, &flags)) {
when PyArg_ParseTuple() succeeds
taking False path
63     return NULL;
64   }
65 
66   GeoIP = PyObject_New(GeoIP_GeoIPObject, &GeoIP_GeoIPType);
when _PyObject_New() succeeds
_PyObject_New allocated at:   GeoIP = PyObject_New(GeoIP_GeoIPObject, &GeoIP_GeoIPType);
ob_refcnt is now refs: 1 + N where N >= 0
67 
68   GeoIP->gi = GeoIP_open(filename, flags);
69 
70   if (!GeoIP->gi) {
when treating unknown struct GeoIP * from py_GeoIP.c:68 as NULL
taking True path
71     PyErr_SetString(PyGeoIPError,  "Can't create GeoIP->gi object");
calling PyErr_SetString()
72     return NULL;
73   }
74 
75   return (PyObject*)GeoIP;
76 }
ob_refcnt of '*GeoIP' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1

File: py_GeoIP.c
Function: GeoIP_open_Py
Error: dereferencing NULL (GeoIP->gi) at py_GeoIP.c:70
56 static PyObject*
57 GeoIP_open_Py(PyObject* self, PyObject *args) {
58   GeoIP_GeoIPObject* GeoIP;
59   char * filename;
60   int flags;
61 
62   if (!PyArg_ParseTuple(args, "si", &filename, &flags)) {
when PyArg_ParseTuple() succeeds
taking False path
63     return NULL;
64   }
65 
66   GeoIP = PyObject_New(GeoIP_GeoIPObject, &GeoIP_GeoIPType);
when _PyObject_New() fails
67 
68   GeoIP->gi = GeoIP_open(filename, flags);
dereferencing NULL (GeoIP->gi) at py_GeoIP.c:70
69 
70   if (!GeoIP->gi) {
71     PyErr_SetString(PyGeoIPError,  "Can't create GeoIP->gi object");
72     return NULL;
73   }
74 
75   return (PyObject*)GeoIP;
76 }