File: | rrdtoolmodule.c |
Function: | PyRRD_graph |
Error: | dereferencing NULL (t->ob_refcnt) at rrdtoolmodule.c:317 |
284 static PyObject *PyRRD_graph(
285 PyObject UNUSED(*self),
286 PyObject * args)
287 {
288 PyObject *r;
289 char **argv, **calcpr;
290 int argc, xsize, ysize, i;
291 double ymin, ymax;
292
293 if (create_args("graph", args, &argc, &argv) < 0)
294 return NULL;
when considering range: 0 <= value <= 0x7fffffff
taking False path
295
296 if (rrd_graph(argc, argv, &calcpr, &xsize, &ysize, NULL, &ymin, &ymax) ==
297 -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
298 PyErr_SetString(ErrorObject, rrd_get_error());
299 rrd_clear_error();
300 r = NULL;
301 } else {
302 r = PyTuple_New(3);
303
when PyTuple_New() succeeds
304 PyTuple_SET_ITEM(r, 0, PyInt_FromLong((long) xsize));
305 PyTuple_SET_ITEM(r, 1, PyInt_FromLong((long) ysize));
when PyInt_FromLong() succeeds
306
when PyInt_FromLong() succeeds
307 if (calcpr) {
308 PyObject *e, *t;
when treating unknown char * * * from rrdtoolmodule.c:297 as non-NULL
taking True path
309
310 e = PyList_New(0);
311 PyTuple_SET_ITEM(r, 2, e);
when PyList_New() succeeds
312
313 for (i = 0; calcpr[i]; i++) {
314 t = PyString_FromString(calcpr[i]);
when treating unknown char * from rrdtoolmodule.c:314 as non-NULL
taking True path
315 PyList_Append(e, t);
when treating unknown char * from rrdtoolmodule.c:315 as non-NULL
when PyString_FromString() fails
316 Py_DECREF(t);
returning -1 from PyList_Append() due to NULL item
317 rrd_freemem(calcpr[i]);
dereferencing NULL (t->ob_refcnt) at rrdtoolmodule.c:317
318 }
319 rrd_freemem(calcpr);
320 } else {
321 Py_INCREF(Py_None);
322 PyTuple_SET_ITEM(r, 2, Py_None);
323 }
324 }
325
326 destroy_args(&argv);
327 return r;
328 }
329
File: | rrdtoolmodule.c |
Function: | PyRRD_graph |
Error: | calling PyList_Append with NULL as argument 1 (e) at rrdtoolmodule.c:316 |
284 static PyObject *PyRRD_graph(
285 PyObject UNUSED(*self),
286 PyObject * args)
287 {
288 PyObject *r;
289 char **argv, **calcpr;
290 int argc, xsize, ysize, i;
291 double ymin, ymax;
292
293 if (create_args("graph", args, &argc, &argv) < 0)
294 return NULL;
when considering range: 0 <= value <= 0x7fffffff
taking False path
295
296 if (rrd_graph(argc, argv, &calcpr, &xsize, &ysize, NULL, &ymin, &ymax) ==
297 -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
298 PyErr_SetString(ErrorObject, rrd_get_error());
299 rrd_clear_error();
300 r = NULL;
301 } else {
302 r = PyTuple_New(3);
303
when PyTuple_New() succeeds
304 PyTuple_SET_ITEM(r, 0, PyInt_FromLong((long) xsize));
305 PyTuple_SET_ITEM(r, 1, PyInt_FromLong((long) ysize));
when PyInt_FromLong() succeeds
306
when PyInt_FromLong() succeeds
307 if (calcpr) {
308 PyObject *e, *t;
when treating unknown char * * * from rrdtoolmodule.c:297 as non-NULL
taking True path
309
310 e = PyList_New(0);
311 PyTuple_SET_ITEM(r, 2, e);
when PyList_New() fails
312
313 for (i = 0; calcpr[i]; i++) {
314 t = PyString_FromString(calcpr[i]);
when treating unknown char * from rrdtoolmodule.c:314 as non-NULL
taking True path
315 PyList_Append(e, t);
when treating unknown char * from rrdtoolmodule.c:315 as non-NULL
when PyString_FromString() succeeds
316 Py_DECREF(t);
calling PyList_Append with NULL as argument 1 (e) at rrdtoolmodule.c:316
PyList_Append() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
317 rrd_freemem(calcpr[i]);
318 }
319 rrd_freemem(calcpr);
320 } else {
321 Py_INCREF(Py_None);
322 PyTuple_SET_ITEM(r, 2, Py_None);
323 }
324 }
325
326 destroy_args(&argv);
327 return r;
328 }
329
File: | rrdtoolmodule.c |
Function: | PyRRD_graph |
Error: | returning (PyObject*)NULL without setting an exception |
284 static PyObject *PyRRD_graph(
285 PyObject UNUSED(*self),
286 PyObject * args)
287 {
288 PyObject *r;
289 char **argv, **calcpr;
290 int argc, xsize, ysize, i;
291 double ymin, ymax;
292
293 if (create_args("graph", args, &argc, &argv) < 0)
294 return NULL;
when considering range: -0x80000000 <= value <= -1
taking True path
295
296 if (rrd_graph(argc, argv, &calcpr, &xsize, &ysize, NULL, &ymin, &ymax) ==
297 -1) {
298 PyErr_SetString(ErrorObject, rrd_get_error());
299 rrd_clear_error();
300 r = NULL;
301 } else {
302 r = PyTuple_New(3);
303
304 PyTuple_SET_ITEM(r, 0, PyInt_FromLong((long) xsize));
305 PyTuple_SET_ITEM(r, 1, PyInt_FromLong((long) ysize));
306
307 if (calcpr) {
308 PyObject *e, *t;
309
310 e = PyList_New(0);
311 PyTuple_SET_ITEM(r, 2, e);
312
313 for (i = 0; calcpr[i]; i++) {
314 t = PyString_FromString(calcpr[i]);
315 PyList_Append(e, t);
316 Py_DECREF(t);
317 rrd_freemem(calcpr[i]);
318 }
319 rrd_freemem(calcpr);
320 } else {
321 Py_INCREF(Py_None);
322 PyTuple_SET_ITEM(r, 2, Py_None);
323 }
324 }
325
326 destroy_args(&argv);
327 return r;
328 }
329