Martin v. Löwis <mar...@v.loewis.de> added the comment: > Whenever the documentation says "you must not" it really says "don't do > that or your application *will* crash, burn and die"... Of course I can > allocate storage for the string, copy it's content and then free or - > nothing will happen. How would it cause a crash - it's my own pointer.
Suppose you do char *s = malloc(MAXPATH); if (!PyArg_ParseTuple("s", &s))return NULL; do_something_with(s); free(s); then your application *will* crash, burn, and die - because s gets changed in the call; the original malloc result is garbage, and the free call will likely crash the malloc implementation (as the block it points to wasn't malloc-allocated, and isn't the beginning of a block). _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4746> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com