On Wed, Jan 10, 2001 at 09:41:29PM -0800, Moshe Zadka wrote: > Update of /cvsroot/python/python/dist/src/Python > In directory usw-pr-cvs1:/tmp/cvs-serv21213/Python > > Modified Files: > ceval.c sysmodule.c >... > --- 1246,1269 ---- > case PRINT_EXPR: > v = POP(); > ! w = PySys_GetObject("displayhook"); > ! if (w == NULL) { > ! PyErr_SetString(PyExc_RuntimeError, > ! "lost sys.displayhook"); > ! err = -1; > } > + if (err == 0) { > + x = Py_BuildValue("(O)", v); > + if (x == NULL) > + err = -1; > + } > + if (err == 0) { > + w = PyEval_CallObject(w, x); > + if (w == NULL) > + err = -1; > + } > Py_DECREF(v); > + Py_XDECREF(x); x was never initialized to NULL. In fact, the loop sets it to Py_None. If you get an error in the initial "w" setup case, then you could erroneously decref None. Further, there is no DECREF for the CallObject result ("w"). But watch out: you don't want to DECREF the PySys_GetObject result (that is a borrowed reference). Cheers, -g -- Greg Stein, http://www.lyra.org/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4