File: | src/python_module.c |
Function: | pm_load_script |
Error: | ob_refcnt of return value is 1 too low |
47 static PyObject *pm_load_script(const char *filename, OSyncError **error)
48 {
49 FILE *fp = fopen(filename, "r");
50 if (!fp) {
51 osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to open file %s", filename);
when treating unknown struct FILE * from src/python_module.c:50 as non-NULL
taking False path
52 return NULL;
53 }
54
55 if (PyRun_SimpleFile(fp, filename) == -1) {
56 osync_error_set(error, OSYNC_ERROR_GENERIC, "Couldn't run module from file %s", filename);
when PyRun_SimpleFileExFlags() succeeds
taking False path
57 PyErr_Print();
58 return NULL;
59 }
60
61 PyObject *module = PyImport_AddModule("__main__");
62 if (!module) {
when PyImport_AddModule() succeeds
borrowed reference returned by PyImport_AddModule() allocated at: PyObject *module = PyImport_AddModule("__main__");
ob_refcnt is now refs: 0 + N where N >= 1
63 osync_error_set(error, OSYNC_ERROR_GENERIC, "Couldn't load module from file %s", filename);
taking False path
64 PyErr_Print();
65 return NULL;
66 }
67 return module;
68 }
69
File: | src/python_module.c |
Function: | pm_load_script |
Error: | returning (PyObject*)NULL without setting an exception |
47 static PyObject *pm_load_script(const char *filename, OSyncError **error)
48 {
49 FILE *fp = fopen(filename, "r");
50 if (!fp) {
51 osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to open file %s", filename);
when treating unknown struct FILE * from src/python_module.c:50 as non-NULL
taking False path
52 return NULL;
53 }
54
55 if (PyRun_SimpleFile(fp, filename) == -1) {
56 osync_error_set(error, OSYNC_ERROR_GENERIC, "Couldn't run module from file %s", filename);
when PyRun_SimpleFileExFlags() succeeds
taking False path
57 PyErr_Print();
58 return NULL;
59 }
60
61 PyObject *module = PyImport_AddModule("__main__");
62 if (!module) {
when PyImport_AddModule() fails
thread-local exception state now has value: (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from src/python_module.c:62
63 osync_error_set(error, OSYNC_ERROR_GENERIC, "Couldn't load module from file %s", filename);
taking True path
64 PyErr_Print();
65 return NULL;
calling PyErr_Print()
thread-local exception state now has value: (struct PyObject *)0 from src/python_module.c:65
66 }
67 return module;
68 }
69