File: neo_cgi.c
Function: python_upload_cb
Error: dereferencing NULL (result->ob_refcnt) at neo_cgi.c:146
116 static int python_upload_cb (CGI *cgi, int nread, int expected)
117 {
118   CGIObject *self = (CGIObject *)(cgi->data);
119   PyObject *cb, *rock;
when treating unknown struct CGI * from neo_cgi.c:117 as non-NULL
120   PyObject *args, *result;
121   int r;
122 
123   /* fprintf(stderr, "upload_cb: %d/%d\n", nread, expected); */
124   cb = self->upload_cb;
125   rock = self->upload_rock;
when treating unknown void * from neo_cgi.c:119 as non-NULL
126   
127   if (cb == NULL) return 0;
128   args = Py_BuildValue("(Oii)", rock, nread, expected);
when treating unknown struct PyObject * from neo_cgi.c:125 as non-NULL
taking False path
129 
when Py_BuildValue() succeeds
130   if (args == NULL) {
131     self->upload_error = 1;
taking False path
132     return 1;
133   }
134   result = PyEval_CallObject(cb, args);
135   Py_DECREF(args);
when PyEval_CallObjectWithKeywords() fails
136   if (result != NULL && !PyInt_Check(result)) {
when taking True path
137     Py_DECREF(result);
taking False path
138     result = NULL;
139     PyErr_SetString(PyExc_TypeError,
140 	"upload_cb () returned non-integer");
141     self->upload_error = 1;
142     return 1;
143   }
144   r = PyInt_AsLong(result);
145   Py_DECREF(result);
when PyInt_AsLong() succeeds
146   result = NULL;
dereferencing NULL (result->ob_refcnt) at neo_cgi.c:146
found 3 similar trace(s) to this
147   return r;
148 }
149